is it possible - Calc macro start program 'gedit' with file name

2 replies [Last post]
fixxser
fixxser's picture
Offline
Last seen: 2 days 15 hours ago
Title:
Joined: 18 May 2016
Posts: 5
I’m running Ubuntu. Is it possible running a libreoffice calc macro, to start a system program e.g. from terminal. I just want to give a user an option to view a file. Here is what the command would look like: gedit myDir+”/convertNames.log”

Now I have successfully opened “convertNames.log” with writer in the macro I’m writting, but that is too much for just viewing a log file.

Any idea’s

Thanks,

Thanks, fixxser
Ratskinger
Offline
Last seen: 4 days 18 hours ago
Title: ★★★★
Joined: 23 Feb 2016
Posts: 91
Should work with `Shell`
Should work with `Shell` command.

Currently use this line in a base macro:


Shell "bash -c '/home/somedirectory/a/testSH.sh'"

Also used ‘curl’ & others – xubuntu and Mint.

Yours would be:


  Sub ListSub
      Shell "bash -c 'gedit /home/myDir/convertNames.log'"
  End Sub

Tested it with one of my files & works fine. Just make sure you test your statement in Terminal first. Statement as shown will produce nothing if there are errors.

fixxser
fixxser's picture
Offline
Last seen: 2 days 15 hours ago
Title:
Joined: 18 May 2016
Posts: 5
works perfect, thanks, I made
works perfect, thanks, I made a modification so I can use a variable, and it all works. Here is what it ended up to look like. —————-

sText = “bash -c ‘gedit “ + Targetname + “’”

Shell sText
—————-

Much obliged.

Thanks, fixxser

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.