I am developing a stack that is a GUI for a command-line tool, for MacOS X. I want to include the command-line tool itself with my standalone build.
I have added the command-line tool file in the "Copy Files" pane of the Standalone Application Settings dialog. When I build the standalone, it is indeed being copied into the bundle - it puts it right the same sub-directory as the main executable for the app. The questions that I have are:
1) How can I find the complete file path to the included file? I need to reference is on several shell() calls in my scripts![/1]
2) When I'm writing my scripts in the LiveCode IDE, I will have to use a certain path in shell() for the command-line tool. Once that tool is bundled in the standalone, the path will change. How will shell() know whether it's running from the IDE, or from a standalone - and adjust its path accordingly?
Or, is there an easier way to do this that I'm missing?...
Any guidance would be much appreciated.
Path to a Copied File in Mac Standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Path to a Copied File in Mac Standalone
Hi Igor,
...
Best
Klaus
Ever right-clicked a Mac APP bundle and checked its content?1) How can I find the complete file path to the included file? I need to reference is on several shell() calls in my scripts!

...
Code: Select all
## Gives the absolute pathname to the standalone (mainstack)
put the effective filename of this stack into tRuntime
set itemdel to "/"
put empty into item -1 of tFile
put tFile & "/" into tPathToYourCopiedFiles_including_CLI
...
SHELL() will only know this fact if you tell it!2) When I'm writing my scripts in the LiveCode IDE, I will have to use a certain path in shell() for the command-line tool.
Once that tool is bundled in the standalone, the path will change.
How will shell() know whether it's running from the IDE, or from a standalone - and adjust its path accordingly?

Code: Select all
...
if the environment = "development" then
## do IDE stuff and supply IDE pathnames
else
## Do RUNTIME stuff, see above...
end if
...
Klaus
Re: Path to a Copied File in Mac Standalone
Klaus, you're a gem: the effective filename and the environment were exactly what I was looking for!
Thank you so much!
Side note: man, you've helped SO MANY people in these forums! You're amazing!
Thank you so much!

Side note: man, you've helped SO MANY people in these forums! You're amazing!
Re: Path to a Copied File in Mac Standalone
Yeah, isn't that suspicious somehow? 
