Open peter88213 opened 1 year ago
Call LibreOffice:
"c:\Program Files\LibreOffice\program\soffice.exe" --writer --accept="socket,host=localhost,port=2002;urp;"
Call Python:
import socket # only needed on win32-OOo3.0.0
import uno# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()# create the UnoUrlResolver
resolver = localContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext )# connect to the running office
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager# get the central desktop object
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)# access the current writer document
model = desktop.getCurrentComponent()
Maybe establish a bridge to the LibreOffice Python interpreter with execnet?
Create a plugin that allows selecting scenes and chapters in LibreOffice from novelyst.