Re: Osascript: Portable Path to Icon
Re: Osascript: Portable Path to Icon
- Subject: Re: Osascript: Portable Path to Icon
- From: Oakman <email@hidden>
- Date: Wed, 13 May 2015 19:58:26 -0400
On May 13, 2015, at 3:30PM, has wrote:
> Oakman wrote:
>
> >> You are using `osascript` to execute an actual AppleScript file, not just passing lines of AS code directly via `-e` options, yes?
>
>
> > osascript -e 'set iconPath to ((path to applications folder as text) ...
>
> Well there you are then. The script isn't loaded from a file, so there isn't going to be a file path for it regardless of what's running it. (As I say, the *correct* behavior would be for `path to me` to raise an "unknown/no file" error here, not return an incorrect value, but AppleScript.)
>
> Either put the AS code in its own file or pass the appropriate path as an argument to `osascript`, like this:
>
> osascript -e 'on run {filePath}' -e ... -e 'end run' "$filePath"
Thank you again, has. I'm carpenter not a programmer, but I'll see what I can do... :)
-Oakman-
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden