OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Cannot run python macro from command line

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
ossman
Newbie
Newbie


Joined: 21 Sep 2006
Posts: 2

PostPosted: Thu Sep 21, 2006 7:37 am    Post subject: Cannot run python macro from command line Reply with quote

I've constructed a small script that I've placed in the Scripts/python folder in my home dir. The macro works fine when executed from inside OOo, but as I intend to use this in a larger script system it must also work from the command line. Unfortunately it doesn't Sad

Basic macros work fine, it's just Python stuff that refuses to do anything. I've tried the version on FC5, the one on Ubuntu and a build directly from OOo, all with the same result.

I did a strace of the process when calling it and it never even comes close to the Scripts folder. So I suspect that Python scripts aren't supported from the command line. Is this the case?

The script is called ~/.openoffice.org2/user/Scripts/python/Standard/pdf.py and the method I try to call is Test(). The following command line is used:

ooffice macro:///Standard.pdf.Test()


Help! Crying or Very sad
Back to top
View user's profile Send private message
Danad
OOo Advocate
OOo Advocate


Joined: 22 Feb 2004
Posts: 293
Location: Brasil

PostPosted: Thu Sep 21, 2006 4:35 pm    Post subject: Reply with quote

Maybe:
Code:

soffice.exe “vnd.sun.star.script:Standard.pdf.py?language=Python&location=user”


HTH
Back to top
View user's profile Send private message
ossman
Newbie
Newbie


Joined: 21 Sep 2006
Posts: 2

PostPosted: Fri Sep 22, 2006 12:48 am    Post subject: Reply with quote

That was enough to help me find the solution at least Smile

The following works:

Code:
soffice.exe "vnd.sun.star.script:Standard/pdf.py\$Test?language=Python&location=user"


I figured out this by digging through the pyuno source. Is this properly documented some place? I still haven't figured out how to pass parameters.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group