Re: osascript - path to me
Re: osascript - path to me
- Subject: Re: osascript - path to me
- From: garbanzito <email@hidden>
- Date: Wed, 22 May 2002 16:12:33 -0600
at 2002 05 22, 00:04 -0700, they whom i call Chris Page wrote:
On Tuesday, May 21, 2002, at 10:51 PM, garbanzito wrote:
i haven't thought this through or attempted to implement it, but it
would seem that if an "application bundle" could be wrapped around
a script, and if in that bundle were a resource that was a small
applet (for which "path to me" works as expected), then perhaps the
main script could call the applet to reliably get the location. and
application bundles work on Mac OS 9 too, so just maybe it would be
a backwardly compatible, though kludgey, solution.
Maybe I missed something, but I thought "path to me" works fine for
script applets? Although support for bundled applets sounds nice
(and I thought that's what AppleScript Studio already produces), I
think the problem of getting to resources in applets is a solved one.
i wasn't solving the problem for applets. i was talking
about an applet (A) that would accompany a non-applet script
(B), within B's bundle, and provide B with its path so that
other resources could be found. presumably if B can be
found, so can A ...
but after thinking about it, i think neither an auxiliary
applet nor a bundle is necessary. instead, just structure
the non-applet script with a handler like this:
property my_path : "i don't know"
on set_path (the_path)
set my_path to the_path
end set_path
and call set_path() at the point the script object is
loaded. presumably at that point the path *is* known ...
henceforth the script can be passed to another environment
and retain knowledge of it's path.
--
steve harley email@hidden
_______________________________________________
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.