Re: Get Name of Current Script?
Re: Get Name of Current Script?
- Subject: Re: Get Name of Current Script?
- From: has <email@hidden>
- Date: Sun, 3 Oct 2004 22:58:42 +0100
Jon Pugh wrote:
>is there a vanilla way
>to get the name, and better, the path of a running script (not applet)
executed from a script menu from an app like iTunes?
This is possible, but only with support from the application running
the script. In the old days some apps overrode "path to me" but
these days I think we've decided that a property is cleaner.
We should get the AE Registrar to endorse a standard property, like
the one InDesign uses, for example. This property would need to be
implemented by anyone implementing a script menu or palette and
would only provide a file when a script is actually running.
Actually, I think this is something that is belongs the OSA API
itself; and its continuing absence is _sorely_ missed. While merely
annoying for AppleScript, it's could be a serious problem for
implementing OSA support in other languages such as Python. Reason
is: unix-derived languages like Python are much more heavily
dependent on the filesystem, tending to treat it more or less as
another part of the runtime namespace.
For example, Python allows modules to be imported not just from
absolute locations such as the standard library folder, but also from
locations relative to the script currently doing the importing. In
fact, this is such common practice that I reckon any Python
distribution that _didn't_ support it would be considered virtually
useless for every day use.
Which is a bit of a show-stopper if one wants to join the ranks of
OSA languages currently available[1]; something that one [speaking as
unofficial OSA fanboy for MacPython here] would very much like to do
indeed. :) [2]
Cheers,
has
[1] i.e. Essentially just AppleScript... joined perhaps on a good day
by UserTalk and JavaScript OSA. OSA deserves much better!
[2] Not that OSS language developers are entirely guiltless - after
all, their rush to OSA adoption is <ahem> rather less than
enthusiastic - but I think it's a bit of a two-way street here; and
with OS X being so solidly rooted in Unix as well as Mac philosophy I
think the OSA API has been a little slow to respond to this change.
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
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