Re: Osascript: Portable Path to Icon
Re: Osascript: Portable Path to Icon
- Subject: Re: Osascript: Portable Path to Icon
- From: has <email@hidden>
- Date: Wed, 13 May 2015 20:30:52 +0100
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"
HTH
has
_______________________________________________
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