Re: "path to resource" in a tell Finder statement doesn't work
Re: "path to resource" in a tell Finder statement doesn't work
- Subject: Re: "path to resource" in a tell Finder statement doesn't work
- From: "Nigel Garvey" <email@hidden>
- Date: Mon, 9 Jan 2006 17:32:04 +0000
Andrea -XFox- Govoni wrote on Mon, 09 Jan 2006 16:23:58 +0100:
>However, maybe it should be made clearer in the ScriptingAdditions
>dictionary, as it states:
>
>path to resource�v : Return the full path to the specified resource
> path to resource string : the name of the requested resource
> [in bundle file] : an alias or file reference to the bundle containing
>the resource (default is the current application/script bundle)
>
>I interpreted "default is the current application/script bundle" as the
>application or script bundle from which the command is executed.
>Shouldn't be less misleading "default is the current application" and stop?
I think you're right. The dictionary doesn't accurately describe what
happens. The 'current application' is properly either the application
running the script or the application set in the script's 'parent'
property, if one is defined. But the default bundle for 'path to
resource' is the target of the current implied or actual 'tell' block.
It's 'it', not 'me'.
Obviously the cure is either not to use the command in another
application's 'tell' block, or, if that can't be avoided, to use one of
the following:
tell application "Finder"
-- Either:
set iconToUse to (path to resource "applet.icns" in bundle (path to me))
-- Or:
tell me to set iconToUse to (path to resource "applet.icns")
end tell
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden