Re: "path to me" vs ":"
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.