Re: Name of file or folder of current script...
Re: Name of file or folder of current script...
- Subject: Re: Name of file or folder of current script...
- From: Michael Terry <email@hidden>
- Date: Mon, 21 Jul 2003 11:03:09 -0700
On 7/21/03 9:29 AM, "Steven D. Majewski" <email@hidden> wrote:
>
> Is there a way to obtain the file name of the script being current
>
> executed, or even its folder name?
>
>
>
>
"( path to me )" will give you the path of the applescript app,
>
however, if
>
you run in from script editor, you'll get the path to script editor.
>
>
Try this from the editor, and then save it as an application an try it
>
again:
>
>
display dialog (path to me) as string
When I'm working on an applet, I like to do this in SE 2:
--==========================================================================
property pathToMe: path to me
property pathToMe : alias (POSIX file (path of front document))
display dialog pathToMe as string
--==========================================================================
When editing in SE, comment out the first property; when done editing,
comment out the second one instead. Presumably, something similar can be
done in the other scriptable editors.
Unfortunately, you can't get the 'path to me' of a compiled script, or at
least it won't give you what you probably want. The fact that no portable
method for retrieving a compiled script's path exists is a longstanding
problem.
Mike
_______________________________________________
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.