Re: Application Bundles in Panther
Re: Application Bundles in Panther
- Subject: Re: Application Bundles in Panther
- From: Christopher Nebel <email@hidden>
- Date: Tue, 4 Nov 2003 10:08:50 -0800
On Nov 3, 2003, at 5:36 PM, Walter Ian Kaye wrote:
At 04:00p -0800 11/03/2003, Christopher Nebel didst inscribe upon an
electronic papyrus:
There is no way to get the on-disk location of a plain script,
bundled or otherwise, for the same reasons that have always been
there.
What are those reasons?
"Path to me" returns the path of the host application, not the
script. Sorry.
Could something be implemented like, say, 'path to current script'?
Or are scripts loaded without any reference to their source file so
there's nothing to return in the first place? (And if that's the case,
could it be improved in the future?)
Essentially, the problem is that there is no API for setting the
location of the script, so AppleScript has no idea where the script
file (if indeed one exists) is located. A clever developer could
implement something on their own, and if they're particularly clever,
they could even override "path to me", as Smile does, but this is not
the same thing as an OS-level solution that works everywhere.
This could at least theoretically be improved in the future. There are
new APIs in Panther for dealing with script files [1], so those could
be enhanced to give callers the functionality for free, but people
doing stuff by hand would require some additional API calls. (However,
there aren't that many of them.)
--Chris Nebel
AppleScript Engineering
[1] These were added so developers could deal with script files
without knowing anything about the various file flavors (five, at last
count). There are four calls -- OSALoadFile, OSAStoreFile,
OSALoadExecuteFile, and OSADoScriptFile -- which parallel the same
calls without the "File" in the name.
_______________________________________________
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.