Re: how can script bundles store extra stuff?
Re: how can script bundles store extra stuff?
- Subject: Re: how can script bundles store extra stuff?
- From: Matt Neuburg <email@hidden>
- Date: Sat, 23 Jul 2005 13:02:49 -0700
On Sat, 23 Jul 2005 08:42:02 -0700, Matt Neuburg <email@hidden> said:
>In the new Script Editor, when you save a script in script bundle format,
>there's a drawer that seems to invite the user to store extra stuff inside
>the script bundle.
>
>But how can this extra stuff be used?
>
>* path to me -> path to Script Editor, not the script bundle
>
>* path to it -> path to Script Editor, not the script bundle
>
>* path to resource "blahblah" -> works great for a path to a resource inside
>the Script Editor! but cannot access anything inside the script bundle. The
>dictionary says loudly that it should work for a script bundle (it says this
>is the default bundle) but I can't make it do so.
Okay, so to sum up:
(1) The dictionary entry for "path to resource" is lying. It claims
explicitly that by default it will look in the script bundle, but that's not
true. In the case of a script bundle, you must supply explicitly the
pathname of that script bundle.
(2) "path to me" will get you the pathname of the script bundle, but not if
you're running from within Script Editor. (I regard this as either a bug in
Script Editor or darned silly.) You have to use a script runner such as the
Script Menu. Even then you can't be sure. Some script runners do the right
thing; others don't. Entourage doesn't even see the script (no big
surprise). iTunes sees it, but thinks it is called "main.scpt" no matter
what the script bundle is called, and "path to me" gets iTunes's pathname,
not the script's. BBEdit does exactly the right thing.
m.
PS But remember, this is an easy language, excellent for naïve end users.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden