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?
Execution of external program or data file
Re: Execution of external program or data file
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
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
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$ .. "\"")