@Ratslinger is right, you only can run LO macros from command line if you connect to a listening LO instance.
XSCRIPTCONTEXT
is a global variable set by the scripting framework, if a macro is started (from within or through socket).
PyCharm doesn’t resolve this. And all the SDK libraries (com.sun.star.*
) won’t resolve either. I didn’t find a solution by now.
Additional note: LO only reloads python scripts in the Scripts
folder, if their timestamp is newer than the one remembered after first execution.
I use symlinks to an external directory (for not clustering the “Macros execute…” dialogue, having test files and version control system files in that directory, too) and wrote a script which monitors the symlink’s target(s) and update the timestamp if necessary.
Drop me a note if you’d like a copy.