Page 1 of 1
Python Macro Tutorial
Posted: Fri Nov 28, 2008 10:57 pm
by micksulley
Hi,
I am trying to learn Python Macros for Open Office, particularly for spreadsheets. I have found lots of bits, some reasonable stuff on Python as standalone, but nothing that tells me how to use it for macors. Can someone point me to a good tutorial and a list of functions.
Thanks
Mick
Re: Python Macro Tutorial
Posted: Fri Nov 28, 2008 11:18 pm
by Villeroy
http://wiki.services.openoffice.org/wik ... ent_python
Page title is misleading. Extensions are only one aspect. Most of the linked stuff is about Python and OOo in general. The most difficult thing is the UNO-API which is independent from language. You need to understand how to express anything in Python while knowing the thing you are talking to (UNO). No matter what language you are going to use, UNO needs to "understand" what you want it to do.
The very first macro you need to call in Python is a Basic macro:
http://www.oooforum.org/forum/viewtopic.phtml?t=69350
Get xray from OOoMacros.org
Re: Python Macro Tutorial
Posted: Fri Nov 28, 2008 11:34 pm
by micksulley
Thanks for the reply.
OK I guess my questions split in 2 then.
1) Where can I find a tutorial for UNO
2) Where can I find a list of functions that I can call in Python, e.g. to return the value in current cell, move to a different cell, write a new value to a cell, etc. From what you have said I guess it does not matter what language is used, it calls a UNO function, is that correct?
Thanks
Mick
Re: Python Macro Tutorial
Posted: Fri Nov 28, 2008 11:38 pm
by micksulley
Sorry, just noticed the link on the head of your post. Let me check that out.
Thanks for your help
Mick
Re: Python Macro Tutorial
Posted: Sat Nov 29, 2008 10:08 am
by Villeroy
micksulley wrote:Sorry, just noticed the link on the head of your post. Let me check that out.
Thanks for your help
Mick
And I forgot to mention
IMPORTANT: Workarounds for pyuno problems in OOo3.0.0
In this site's forum for code snippets I published some simple (more or less) working macros. User DannyB on OOoForum.org was the pioneer indroducing pyuno to the "outside world" (whatever that is).