Wednesday 4 August 2021

create instance with given context

I can not create instance with given context as explained here...

https://thejeshgn.com/2019/05/27/python-in-libreoffice-macros/

I used this code:

>>> import uno
>>> context = uno.getComponentContext()
>>> desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)  

And got this error:

INTERACT

Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu552037uadn.tmp_\apso-v2.oxt\python\pythonpath\apso_utils.py", line 649, in interact
    line = self.raw_input(prompt)
  File "C:\Program Files\LibreOffice\program\python-core-3.8.8\lib\code.py", line 274, in raw_input
    return input(prompt)
EOFError: EOF when reading a line

I used APSO console through the extension....

https://extensions.libreoffice.org/en/extensions/show/apso-alternative-script-organizer-for-python



from create instance with given context

No comments:

Post a Comment