• 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: "path to me" vs ":"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "path to me" vs ":"


  • Subject: Re: "path to me" vs ":"
  • From: vectormation <email@hidden>
  • Date: Sat, 8 Dec 2001 17:41:56 -0500

It's entirely possible that I am clueless, but why would you want to
define an app as your parent? What advantages does it bestow?

~Phi

>> A simple means of replacing the ":" trick with "path to me" when you want
>> the path to the enclosing folder is:
>>
>> set myalias to (path to me)
>> tell application "Finder"
>> set mypath to folder of myalias
>> end tell
>> set mypath to mypath as string
>>
>> This is shorter than using Text Item Delimiters to lop off the end of the
>> path, and has the advantage of not assuming the path delimiter.
>
>So, in an old discussion, the problem was when the parent isn't the script
>itself. For example, if you're using standard additions and 1 app, and you
>define this app as the parent, "path to me" will never return the path to
>the running app.
>
>This stupid script demonstrates it:
>
>property parent : application "URL Access Scripting"
>
>set myalias_1 to (":" as alias)
>display dialog myalias_1
>-- returns path to container of the running app
>
>set myalias_2 to (path to me)
>tell app "Finder"
> set mypath to folder of myalias_2
>end tell
>display dialog mypath
>-- returns path to container of "URL Access Scripting"
>_______________________________________________
>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.


  • Prev by Date: Re: Scripts no longer work in 9.2...
  • Next by Date: Re: Scripts no longer work in 9.2...
  • Previous by thread: Re: "path to me" vs ":"
  • Next by thread: Re: "path to me" vs ":"
  • Index(es):
    • Date
    • Thread