HI, when I run my script from the Hollywood GUI/Interpreter, DownloadFile() saves files in the same directory as the .hws script.
But when I compile the script as a standalone macOS app (ARM64), the files are saved inside the App Bundle at MyApp.app/Contents/Resources/
How can I make it save next to the .app file instead? I am looking for a solution that can be implemented in the main script so that it remains compatible with other platforms (avoiding a macOS-only version).
Thanks!
macOS paths
Re: macOS paths
Dont know about macos pecularities but
Basically stringWithFile$=DownloadFile() download file in the string, and then you save the stringWithFile$ wherever you want!
On top of that ,if there is a diffirent behavioir under some circumentances , like as you said between compiled/script
You can use preprocessor @IF to keep diffirence i.e
Basically stringWithFile$=DownloadFile() download file in the string, and then you save the stringWithFile$ wherever you want!
On top of that ,if there is a diffirent behavioir under some circumentances , like as you said between compiled/script
You can use preprocessor @IF to keep diffirence i.e
Code: Select all
@IF #final_app=true
; do some stuff
@ELSE
; do it diffient
@ENDIFChristos
Re: macOS paths
To make things different for the application type:
And to get the paths you can use GetSystemInfo():
Now you have si.AppData and si.AppBundle or you could use relative paths like "../../.." to get out of the appBundle.
Code: Select all
Local prgtype, prgname$, hw$ = GetProgramInfo()
Switch prgtype
Case #PRGTYPE_SCRIPT:
...
Case #PRGTYPE_APPLET:
...
Case #PRGTYPE_PROGRAM:
Code: Select all
Local GVtbl=GetVersion()
If GVtbl.platform="MacOS"
Local si=GetSystemInfo()
Re: macOS paths
Thank you so much, both! I'll try it out. Cheers!