• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Name of file or folder of current script...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Name of file or folder of current script... (From: "Steven D. Majewski" <email@hidden>)

  • Prev by Date: What to make of the "AppleScript Experience"
  • Next by Date: Sigma Additions
  • Previous by thread: Re: Name of file or folder of current script...
  • Next by thread: What to make of the "AppleScript Experience"
  • Index(es):
    • Date
    • Thread