[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LuaCOM example
- From: chase@...
- Date: Mon, 19 Nov 2001 20:19:13 -0000
Greetings,
I first encountered Lua through PLua, a surprisingly mature and
effective Lua environment for the PalmOS. I have used Python for
several years. I am interested in using Lua for situations where
Python is too large.
I am writing to ask LuaCOM users to post a few more examples. I have
studied the ADO example included with LuaCom, but I can't make it
work with Word or WScript as in the Python snippets below. If LuaCom
can use an instance of WScript, then it could be used for may Windows
system administration functions.
For instance, in Python I do something like this to translate rft
documents to word format documents:
import win32com.client
docpath = "c:\\rtfdocuments"
o = win32com.client.Dispatch("Word.Application")
for docname in docpath:
d = o.Documents.Open(docpath + "\\" + docname)
newname = docname.replace("RTF", "DOC")
d.SaveAs(targ + "\\" + newname,
win32com.client.constants.wdFormatDocument)
d.Close()
Or, to map a network drive:
net = win32com.client.Dispatch("WScript.Network")
net.MapNetworkDrive("K:", "\\\\server\\share", 0, "user", "pw")
Thank you for your time.
--Tim Chase