• 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: Osascript: Portable Path to Icon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Osascript: Portable Path to Icon (From: has <email@hidden>)

  • Prev by Date: Re: Osascript: Portable Path to Icon
  • Next by Date: How to set "different first page header footer" using an AppleScript
  • Previous by thread: Re: Osascript: Portable Path to Icon
  • Next by thread: How to set "different first page header footer" using an AppleScript
  • Index(es):
    • Date
    • Thread