Re: Application Bundles in Panther
Re: Application Bundles in Panther
- Subject: Re: Application Bundles in Panther
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 02 Nov 2003 07:29:40 -0800
On 11/2/03 6:05 AM, "Walter Ian Kaye" <email@hidden> wrote:
>
At 03:08a -0500 11/02/2003, Tom Walther didst inscribe upon an
>
electronic papyrus:
>
>
> OS X 10.3 Panther allows new (I think) saving options for
>
> Applescripts: Script Bundle and Application Bundle.
>
>
>
> This is huge--finally I can include the movies and images my scripts
>
> reference inside the app itself.
>
>
>
> However, I can't figure out how to reference items in the bundle
>
> (ex. in Contents/Resources) with a relative path from inside the
>
> script. It works fine if I use absolute paths, but that requires
>
> placing the script in a very specific location. Can anyone tell me
>
> what kind of path I should use to a .jpg or .mov file in the script
>
> bundle? Can you provide an example?
>
>
I don't know if there's an official answer, but I'm guessing maybe
>
you could create a dummy app with a unique creator code (or bundle
>
id), get its path via Finder, and-- oh wait, is 'application file id'
>
restricted to the same 3- levels under /Applications as other apps?
>
OK, maybe that won't work after all.
>
'Twas a nice idea while it lasted.
What's wrong with setting a variable to 'path to me as Unicode text'?
'path to me' gives the path to the application running the script. (So don't
test it in Script Editor where the result will be Script Editor. If you have
Script Debugger, you can set one its prefs to return the application.) I
haven't tested this yet, so in the case of a bundle I don't know whether it
will return the package (my guess) or the real app file hidden inside. But
whichever it is, the structure from that point on, using ":Contents:" and so
on, will be relative and will work on any computer, using the variable (or a
parsing of it if it refers to the interior file) as the first part of any
file path in the bundle.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.