Can Calc Open 3rd Party Text Editor

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Gonzo714
Posts: 47
Joined: Wed Nov 23, 2016 2:52 pm

Can Calc Open 3rd Party Text Editor

Post by Gonzo714 »

been trying to create a macro to open a 3rd party text editir (i.e Kate/blank.txt) without success.
do not want Libre Writer, needs to be a text editor.
is this possible????

Allow me to addon.....
I can create a hypo link to open Kate/blank.txt, but can a macro be made to open, and then save the file with a specific name???
LibreOffice 7.5, Debian 12
User avatar
floris v
Volunteer
Posts: 4432
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: Can Calc Open 3rd Party Text Editor

Post by floris v »

You need to study the Kate API - you will want to send commands from Calc to Kate. And that's really a question that you should ask at a Kate forum.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
JeJe
Volunteer
Posts: 2787
Joined: Wed Mar 09, 2016 2:40 pm

Re: Can Calc Open 3rd Party Text Editor

Post by JeJe »

You can open a file with SystemShellExecute. This works for me on Windows, I presume Linux also.

Code: Select all

  oSvc = createUnoService("com.sun.star.system.SystemShellExecute")
  oSvc.execute(ConvertToUrl("C:\windows\notepad.exe"), "C:\tmp\a.txt", 0)
Controlling an external application afterwards is something different - I suggest renaming or making a copy with the name you want before opening.

(Edit: If Kate doesn't allow the passing of the file path on starting the above won't work of course.)
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply