[Solved] "accept=socket,host=localhost,port=8100;urp"

The Application Programming Interface and the OASIS Open Document Format

[Solved] "accept=socket,host=localhost,port=8100;urp"

Postby vancouver » Sun May 06, 2012 2:02 am

I'm using Windows XP + LibreOffice 3.5.2

I'm trying to setup Python scripting environment. According to some online tutorial(http://stuvel.eu/ooo-python#h2tocholder), I'm supposed to put the following in command line:
"C:\Program Files\LibreOffice 3.5\program\soffice.exe -accept=socket,host=localhost,port=8100;urp;"

What does this line mean? Is this absolutely necessary for Python scripting in Libreoffice? Thanks.
Last edited by vancouver on Thu May 10, 2012 6:56 am, edited 1 time in total.
LibreOffice 3.4.5/Windows XP
vancouver
 
Posts: 26
Joined: Thu Jan 26, 2012 10:55 am

Re: meaning of "accept=socket,host=localhost,port=8100;urp"

Postby FJCC » Sun May 06, 2012 2:29 am

I don't know enough to explain the meaning of that part of the command, but it is part of starting LibreOffice from Python. Python can be used as a macro language without this. You can write Python scripts and store them in the Scripts\python folder of your user profile. You can then start LibreOffice in the normal way and access the Python scripts via buttons, tool bars, key combinations or the menu Tools -> Macros -> Organize Macros -> Python.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8109
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: meaning of "accept=socket,host=localhost,port=8100;urp"

Postby Villeroy » Sun May 06, 2012 2:42 am

If you write a stand-alone computer program in any language you need to start the office in listening mode in order to make it accessible for any other programs such as your own one. No, you don't have to start the office from your program. It just needs to be there listening to some port number. A connected program can query all the UNO objects just like a browser can query web-pages from a http server.
If you write some macro or extension then your code is triggered from within the office process knowing about its context.
This is thoroughly documented with code examples for the Python UNO bridge: http://udk.openoffice.org/python/python-bridge.html. That document answers all your questions.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
 
Posts: 29707
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Meaning of "accept=socket,host=localhost,port=8100;urp"

Postby vancouver » Thu May 10, 2012 6:55 am

Thanks Villeroy.
LibreOffice 3.4.5/Windows XP
vancouver
 
Posts: 26
Joined: Thu Jan 26, 2012 10:55 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests