MAC OS X standalone and externals

Dan Friedman dan at clearvisiontech.com
Thu Jul 10 13:14:00 EDT 2003


Ron,

I had the same type of problem with one of my OSX externals.  I don't know
if this will help, but here's what I did:

First, I had the external re-compiled as a bundle (from the code that was
used to make the original CODE resource and DLL).  So, it was now named
"Spell.bundle".  I placed "Spell.bundle" into a folder named "plug-ins".
Then, I set the externals of my stack to "plug-ins/Spell.bundle".  This
works fine for initializing my spell checker at start up.

FYI: when I set the externals of my stack to "./plug-ins/Spell.bundle" or
"/plug-ins/Spell.bundle", it failed in my standalone.  Only,
"plug-ins/Spell.bundle" worked.

However, when I went to run it, it couldn't find the dictionaries.  Turns
out it was a problem with paths.

When my app starts up, I use this to fill the global variable
"applicationPath" to the path to my application:

on applicationPathAtStartUp
  global applicationPath
  
  put the fileName of this stack into applicationPath
  set the itemDelimiter to "/"
  delete last item of applicationPath
  
  if the platform = "MacOS" then
    if char 1 to 3 of the systemVersion = "10." then
      delete item -3 to -1 of applicationPath
    end if
  end if
end applicationPathAtStartUp

Until I added the OSX "if", this procedure (on OSX) got the path to the
actual application, not the root level of "myStandalone.app".  Next, I found
out that most externals want a FULL PATH to referenced files.  However, this
procedure (on OSX) did not include the drive name, making it an incomplete
path.  So, instead of sending this:

applicationPath & "/plug-ins/AmericanDict.rcs"

I use this (for OSX):

line 1 of the volumes & applicationPath & "/plug-ins/AmericanDict.rcs"

Once I did this, everything works like like a charm!


Hope that helps.

-Dan


 
> Hi
> 
> I am having trouble setting the external of an OS X standalone.
> 
> I think this is a path problem so I've spent a long time tonight trying to
> read the docs on filepaths and searched the archives for info on OS X
> standalones, but I'm still stuck.
> 
> The code works fine in OS 9 both in the ide and as a standalone. It works
> great in OS X in the ide, but when I build a standalone for X the app
> crashes.
> 
> I set the externals to "./VXCMD_macho" and put the Valentina bundle in the
> same folder as the standalone. (I realize the standalone in OS X is a
> folder/bundle, but I do not place it in the contents of the bundle, just on
> the same level as the bundle).
> 
> Applications f
> My Standalone f
>   My App.
>   VXCMD_macho
>   data f
> 
> 
> Valentina inits itself fine, but calling it in a later script crashes.
> 
> Am I setting the external properly? This works in the ide...
> 
> thanks again,
> Ron




More information about the use-livecode mailing list