[Solved] .execute argument issue with linux

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
lua
Posts: 3
Joined: Sat Sep 08, 2018 10:42 am

[Solved] .execute argument issue with linux

Post by lua »

Hi
I have a macro launching video with subtitles in vlc working fine on libreoffice calc under windows 7 that i'm trying to run under linux mint.
My problem is that the .execute add 2 quotes arround the argument that prevent vlc command line to work properly.

I use the command
oShell.execute("vlc", videoetsst, 0)

where videoetsst is a string obtain by the filepicker and manipulate (here videoetsst = file:///path/testbs.mp4 --sub-file //path/test.srt )

from the error message in vlc i think .execute send the command
vlc 'file:///path/testbs.mp4 --sub-file //path/test.srt'
witch fails because the command needed is
vlc file:///path/testbs.mp4 --sub-file //path/test.srt
without the quotes

is there a solution to my problem?
Thanks
Last edited by lua on Fri Sep 21, 2018 11:26 am, edited 4 times in total.
libreoffice 6.0.6.2 (x64)
windows 7
User avatar
RoryOF
Moderator
Posts: 34610
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: .execute argument issue with linux

Post by RoryOF »

A quick test on Xubuntu 18.04.1 works without quotes or using double quotes " from the command line. Alternately, declare vlc to be your system video player and just use a hyperlink to the film and subtitle files, which may need to be quoted (try both double or single quotes).
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
lua
Posts: 3
Joined: Sat Sep 08, 2018 10:42 am

Re: .execute argument issue with linux

Post by lua »

Thanks for answering
I know the command line i need my problem is the how to get it
if i'm correct, it's the .execute argument that add the unwanted quotes so nothing i can do here.
Unfortunatly you can't launch video with subtitle by using the default app for video because of the argument needed to do that
libreoffice 6.0.6.2 (x64)
windows 7
lua
Posts: 3
Joined: Sat Sep 08, 2018 10:42 am

Re: .execute argument issue with linux

Post by lua »

The solution from Ratslinger from friendly forum Asklibreoffice is to launch directly by Shell commnand including the program in the command line and not to use the .execute

Shell "vlc file:///path/testbs.mp4 --sub-file //path/test.srt"

Thanks to every people who have take time to think about it
libreoffice 6.0.6.2 (x64)
windows 7
Post Reply