On 08/10/2008 23:34, norseman wrote:
To whomever this concerns:
In trying to locate specific information I find the OOo WebPages
chasing me around in circles. I also find any information that is not
basically "How to turn the machine on" seems to be missing.
I finally managed to get OOo to actually talk to Python. The
one OOo supplies. I had to look outside OOo. The connection is up and a
sample file works (sort of) after some massaging on my part.
My function is to automate things. Using COM, some Microsoft
programs can be automated under Windows by going to MSN and browsing
(and trial and error from there). I wish to do the same in Linux with
OOo. Preferably with less trial and error.
Where do I find "the verbs" a programmer is to use for
accomplishing any given task(s) for a given OOo 'program'. (writer,
calc, etc...) I see a few in the examples but cannot locate them in any
documentation I've been able to scrounge up.
ANYONE; if you know where to find what I seek, Please, post it to the
list so we can all benefit.
I include the python portion of a test I have been able to run.
To use this you will need to start scalc manually with that long line
of tokens that is documented somewhere. I don't have it handy. Some
sort of help on UNO is where I found it, I think. And you are
supposed to be in ..../OpenOffice..vers../programs to run it. I had a
shell script to cd here and there and reset paths and environmentals
and such. Tell you what - give it a look and see if you can get it to
run too. Don't forget to fix ALL path/filenames below.
============
# A TEST
# works - sort of: """
the writer functions, although badly.
there are no examples of cursor placement in text.
the calc functions, but saveas .csv is NOT text
it winds up PKzipped on disk. Thus useless.
I have yet to find where the verbs below come from. """
#
import uno
local = uno.getComponentContext()
resolver =
local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",local)
context =
resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
desktop =
context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop",context)
#document =
desktop.loadComponentFromURL("file:///home/user/py/z.py","_blank", 0,())
#document = desktop.getCurrentComponent()
#cursor = document.Text.createTextCursor()
#document.Text.insertString(cursor, "This text is being added to
openoffice using python and uno package.", 0)
#document.Text.insertString(cursor, "\n\nThis is a new paragraph.", 0)
#document.storeAsURL("file:///home/user/py/z-tst.py",())
#### above simply puts above text at front of existing file.
#### seems no way to append it instead. Search/Replace? Dream on.
document =
desktop.loadComponentFromURL("file:///home/user/py/x.xls","_blank", 0,
())
document = desktop.getCurrentComponent()
##cursor = document.Text.createTextCursor()
document.storeAsURL("file:///home/user/py/x-tst.csv",())
document.dispose()
desktop.dispose()
#### line above from trial and error. wait on it. might close OOo.
# end of test
============
Let's start with this one:
desktop.loadComponentFromURL("file:///home/user/py/z.py","_blank", 0,())
Why the term "_blank" when the file is not?
What is the 0 for?
What is ()?
And here:
document.storeAsURL("file:///home/user/py/x-tst.csv",())
What is ()?
How DOES one make OOo do the obvious? .csv is text by default so why
is it written out PKzipped? And why does (on Linux) unziping that
.csv create a number of files and directories which are not .csv in
nature while not actually creating the text.csv for others to use?
Where is the description of programmable cursor placement in swriter?
The list of questions is quite lengthy.
Besides:
What is wrong with APP = uno.connect("APPlication",port,whatever)
What is wrong with doc1 = APP.open("filename",mode)? (default rw binary)
What is wrong with flag = doc1.saveas("filename",[t,z],permissions)
What is wrong with flag = doc1.close(doc1,permissions)? (default rw all)
Why all the gobble-d-goop to do the simple?
To follow the examples in OOo and do:
soffice ..... and try to connect and open a file fails.
One need start with scalc ..... or swriter .... or appropriate.
Yes I'm frustrated, but I'm not mad. I like using OpenOffice. I just
wish those in it's driver seat could do something besides just code.
Without proper documentation a program is all but totally useless. You
know that as well as I.
Where is the real documentation? Is it just for the 'inside' crowd only?
Don't actually have any? I can create it, but I have rules.
The web asks for help in all phases of OOo. Just exactly how does one
code without knowing the purpose, name and syntax of each item in the
library in use????
Steve
[EMAIL PROTECTED]
Does this help: http://api.openoffice.org/ ?
--
Harold Fuchs
London, England
Please reply *only* to [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]