Re: Name of this folder
Re: Name of this folder
- Subject: Re: Name of this folder
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 11 Mar 2001 11:57:19 -0800
On 3/11/01 10:36 AM, "Bryan Harris" <email@hidden> wrote:
>
> Explanation:
>
>
>
> ":" as alias
>
>
>
> retuns the path to the container of the script. Note this is a 'trick' you
>
> won't find in the dictionary. In fact, I don't understand it myself. Just
>
> something some clever dude figured out ;)
>
>
>
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) an application
2) a compiled script running from OSA menu
3) a compiled script running from an application's internal script menu
4) a compiled script running in a script editor
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.
3) A compiled script running from an application's internal script menu
(like Entourage's) will return the alias (path) of the folder containing
_the application file_. (The application is 'me' in 'path to me'). So in
Entourage's case that will be the Microsoft Office 2001 folder wherever it
is on your hard disk, since it's the folder where Entourage resides.
4) A compiled script running from a script editor returns the folder where
the script editor itself lives, as for any application (like 3 above). Run
from Script Editor, ":" as alias returns the alias path name to where
Script Editor lives - the AppleScript folder inside the Apple Extras folder
(note the colon on the end - it's a folder, not AppleScript itself). So
alias "PB HM Hard Disk:Applications (Mac OS 9):Apple
Extras:AppleScript:"
as you got. Similarly, run in Smile:
alias "PB HM Hard Disk:Applications (Mac OS 9):Apple
Extras:AppleScript:Smile1.7.2US:Smile :"
--
Paul Berkowitz