Page 1 of 1
Execution of external program or data file
Posted: Wed Mar 11, 2026 6:45 pm
by Bohun
I tried to use execute to open pdf file in vpdf using this function on MorphOS:
If resp = 1
Execute(full$, "")
EndIf
result was "not executable"
Tried tu use path to vpdf was wrong too:
If resp = 1
prog$=AddStr("SYS:Applications/VPDF/VPDF ", full$)
Execute(prog$, "")
EndIf
How to do this?
Re: Execution of external program or data file
Posted: Thu Mar 12, 2026 9:15 am
by GMKai
Code: Select all
/**/
path$="SYS:Applications/VPDF/VPDF"
file$= "Hollywood:Docs/Hollywood.pdf"
;both should work:
;Run(path$, file$)
Execute(path$, file$)
Re: Execution of external program or data file
Posted: Thu Mar 12, 2026 5:19 pm
by Bohun
Thank you, the method you provided does indeed allow to run the program with a parameter. I didn't read the documentation carefully. However, I'm wondering if it's possible to execute a program associated with a PDF document in MorphOS the same way it works for me on MacOS. Execute document.pdf opens the program with the loaded document on the Mac, but not on MorphOS.
Re: Execution of external program or data file
Posted: Fri Mar 13, 2026 8:04 am
by jPV
Bohun wrote: ↑Thu Mar 12, 2026 5:19 pm
However, I'm wondering if it's possible to execute a program associated with a PDF document in MorphOS the same way it works for me on MacOS. Execute document.pdf opens the program with the loaded document on the Mac, but not on MorphOS.
On MorphOS you should use the
Open shell command. It opens files according to filetypes defined in Ambient. It also opens directories and URLs, so it's a generic opener for everything from the shell/scripts. BTW. WBRun is almost the same, but doesn't open iconless files or other things, so Open it is.
Code: Select all
file$= "Hollywood:Docs/Hollywood.pdf"
; Launch a file with the Open shell command on MorphOS.
; Notice that the given argument must be in quotes in
; case of spaces in the filename.
Execute("C:Open", "\"" .. file$ .. "\"")