Execution of external program or data file

Find quick help here to get you started with Hollywood
Post Reply
Bohun
Posts: 18
Joined: Sat Jul 16, 2016 8:34 am
Location: Poland

Execution of external program or data file

Post 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?
GMKai
Posts: 161
Joined: Mon Feb 15, 2010 10:58 am

Re: Execution of external program or data file

Post by GMKai »

Code: Select all

/**/

path$="SYS:Applications/VPDF/VPDF"
file$= "Hollywood:Docs/Hollywood.pdf"

;both should work:
;Run(path$, file$)
Execute(path$, file$)
Bohun
Posts: 18
Joined: Sat Jul 16, 2016 8:34 am
Location: Poland

Re: Execution of external program or data file

Post 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.
User avatar
jPV
Posts: 752
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Execution of external program or data file

Post 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$ .. "\"")
Post Reply