Permission denied on pdf startup in Linux Mint
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Permission denied on pdf startup in Linux Mint
I need to startup pdf files from my application in Linux Mint.(Ubuntu)
I have put : get shell("/home/rob/Documents/Manuals/Manual.pdf") in a mouseUp script
I have set all the directories permissions to "Read and write"
When the script is set to run I get the following message in the it variable: /bin/sh: 1:/home/rob/Documents/Manuals/Manual.pdf: Permission denied.
What do I do wrong?
Thanks
Rob
I have put : get shell("/home/rob/Documents/Manuals/Manual.pdf") in a mouseUp script
I have set all the directories permissions to "Read and write"
When the script is set to run I get the following message in the it variable: /bin/sh: 1:/home/rob/Documents/Manuals/Manual.pdf: Permission denied.
What do I do wrong?
Thanks
Rob
Re: Permission denied on pdf startup in Linux Mint
Just out of curiousity, why not just use -Rob van der Sloot wrote: ↑Mon Apr 19, 2021 2:09 pmI need to startup pdf files from my application in Linux Mint.(Ubuntu)
I have put : get shell("/home/rob/Documents/Manuals/Manual.pdf") in a mouseUp script
Code: Select all
on mouseUp
launch document "/home/rob/Documents/Manuals/Manual.pdf"
end mouseUp
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Re: Permission denied on pdf startup in Linux Mint
launch document "/home/rob/Documents/Manuals/Manual.pdf" does not work in Linux
Re: Permission denied on pdf startup in Linux Mint
It works here on Linux (with a path to one of my local files), which version of Lc are you using, and which version of Mint? Are you positive the file is located at the path you provided?Rob van der Sloot wrote: ↑Mon Apr 19, 2021 4:46 pmlaunch document "/home/rob/Documents/Manuals/Manual.pdf" does not work in Linux
Re: Permission denied on pdf startup in Linux Mint
'launch document' also works here in Arch Linux. 'get shell' is not going to work. Try typing the path to any non executable document in a terminal and see what happens. That's what you're doing when you use 'get shell("/some/path/to/non-executable")'
-
- Livecode Opensource Backer
- Posts: 78
- Joined: Sat Apr 17, 2010 9:21 am
Re: Permission denied on pdf startup in Linux Mint
I always used "launch" to startup an app in windows10.
I made a copy of my W10 app to Linux.
But then it did not work, so I looked in the Dictionary, where it says: To work with Unix "use the shell function instead"
I had never used "launch document"
Now it works fine. Problem solved, thanks.
I made a copy of my W10 app to Linux.
But then it did not work, so I looked in the Dictionary, where it says: To work with Unix "use the shell function instead"
I had never used "launch document"
Now it works fine. Problem solved, thanks.
Re: Permission denied on pdf startup in Linux Mint
Glad to hear it!Now it works fine. Problem solved, thanks.
Launch will also work on 'nix, but for some things, like a .pdf file for instance, you would have to add the application using "with". For instance,But then it did not work, so I looked in the Dictionary, where it says: To work with Unix "use the shell function instead"
I had never used "launch document"
... would also work. {If your on a current Mac, you would probably need to add the .app to whatever program your calling.}launch "'~/.runrev/components/livecodecommunity-6.5.2/Release Notes.pdf'" with okular
To use shell to open a .pdf (or most things, really) like you would in windows on 'nix, you'd have to refer to the most generic format to call the default set in the OS, which would be "xdg-open".
Code: Select all
shell("xdg-open '~/.runrev/components/livecodecommunity-6.5.2/Release Notes.pdf'")
If you want the file to open in a specific application instead of the default, you would simply place that application name in front of the path instead of xdg-open, like so {the following assumes Okular is installed, substitute whatever program your looking for instead}...
Code: Select all
shell("okular '~/.runrev/components/livecodecommunity-6.5.2/Release Notes.pdf'")
On 'nix at least, to launch it from shell, try "xdg-open" first, or test to see if there is a specific program you want it to open in by throwing "put" or "get" in front in the message box, like so...
Code: Select all
put shell("xdg-open '~/.runrev/components/livecodecommunity-6.5.2/Release Notes.pdf'")
Have fun
Re: Permission denied on pdf startup in Linux Mint
Keep in mind that using the 'shell()' function to launch an application is blocking unless you take special precautions to overcome that. It's not difficult but you have to be aware of the problem and know a solution . There are several threads here (search "shell non-blocking") which discuss that if you're interested.
Good luck!
Edit: blocking in this case means your LiveCode application won't normally respond in any way so long as the application opened with 'shell()' is running.
Good luck!
Edit: blocking in this case means your LiveCode application won't normally respond in any way so long as the application opened with 'shell()' is running.