Best way to get the path to one stack/standalone

Sarah Reichelt sarah.reichelt at gmail.com
Mon May 11 22:25:00 EDT 2009


> What is the best way to get the path where is it one stack or standalone? To
> open it from script?

Here is my Mac function for getting the folder containing the app or the stack:

-- get folder containing actual application
-- or stack if in development mode
--
function applicationFolder
  put the effective filename of this stack into tFull
  put empty into tFolder
  set the itemdel to "/"
  repeat for each item i in tFull
    if i contains ".app" or i contains ".rev" then exit repeat
    put i & "/" after tFolder
  end repeat
  return tFolder
end applicationFolder

On the Mac, the actual path is a bit weird as the application itself
is a folder. The executable is inside that folder and you can see it
and all the other components of the app by right-clicking on the app
and choosing "Show Package Contents".

Cheers,
Sarah



More information about the use-livecode mailing list