Re: Name of this folder
Re: Name of this folder
- Subject: Re: Name of this folder
- From: Nigel Garvey <email@hidden>
- Date: Mon, 12 Mar 2001 01:09:37 +0000
Paul Berkowitz wrote on Sun, 11 Mar 2001 11:57:19 -0800:
>
On 3/11/01 10:36 AM, "Bryan Harris" <email@hidden> wrote:
>
>
>> Explanation:
>
>>
>
>> ":" as alias
>
> This just returns "Applescript" for me. Does it only work when running
>
from
>
> other apps?
>
>
>
You must be running it from Script Editor. Sander was using it in an applet
>
(script application), but didn't say so. This sort of thing happens quite a
>
lot here.
>
>
Similarly with Bill Briggs' 'path to me' solution. They both presuppose that
>
the script in question is an application. If it is, then their solutions
>
will work. I'm not sure that Robert, who first asked the question, realized
>
that, nor did he say whether his script is
[...]
>
1) A script application (applet/droplet) will return its container (folder)
>
alias.
>
>
2) A compiled script running from OSA menu behaves like an application in
>
this and other regards: Leonard Rosenthol (who makes OSA menu) has made it
>
so, which is very handy.
Actually, with OSA Menu, while 'path to me' returns the path to the
compiled script, '":" as alias' (or '"" as alias') returns the path to
the folder of the application to which OSA Menu has passed the script -
normally the application that was frontmost when the script was selected
from the menu - which can also be very handy. (I must try writing shorter
sentences.)
tell (a reference to Richard23)
text of "Hey, Artoo. What's this application's folder?" as string
end tell
display dialog (the alias result as string)
8-)
NG