Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigate within the edited document. #20

Open
peter88213 opened this issue Mar 28, 2023 · 2 comments
Open

Navigate within the edited document. #20

peter88213 opened this issue Mar 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@peter88213
Copy link
Owner

Create a plugin that allows selecting scenes and chapters in LibreOffice from novelyst.

@peter88213 peter88213 added the enhancement New feature or request label Mar 28, 2023
@peter88213
Copy link
Owner Author

peter88213 commented Nov 6, 2023

Control LibreOffice from outsides

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()

See this link

@peter88213
Copy link
Owner Author

Maybe establish a bridge to the LibreOffice Python interpreter with execnet?

@peter88213 peter88213 reopened this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant