• 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: using a shell variable in an osascript line?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using a shell variable in an osascript line?


  • Subject: Re: using a shell variable in an osascript line?
  • From: Matthew Smith <email@hidden>
  • Date: Sat, 28 Feb 2009 07:48:55 +1100
  • Thread-topic: using a shell variable in an osascript line?

on 28/02/2009 07:45 , Skeeve at email@hidden wrote:

> Matthew Smith schrieb:
>> Try:
>>    osascript -e 'display dialog system attribute "VAR1"'
>>
>> For some reason I can't use display dialog. I get "no user interaction
>> allowed".
>>
> You're still on Tiger? I get the same with "dialog". But if you replace
> "display dialog" with "return" you see on STDOUT what your commands
> give: Nothing! :-(
>
> But try my solution (with the replacement mentioned above)
>
> osascript -e 'on run argv
>   return (item 1 of argv)
> end run' "$VAR1"

I am on Leopard.

You need the variable to be defined otherwise it will return nothing.

 osascript -e 'return system attribute "TMPDIR"'

Returns a value for me.
/var/folders/9A/9AtEPahnGSquLXI8HpyKG++++TI/-Tmp-/


 _______________________________________________
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

  • Follow-Ups:
    • Re: using a shell variable in an osascript line?
      • From: Skeeve <email@hidden>
References: 
 >Re: using a shell variable in an osascript line? (From: Skeeve <email@hidden>)

  • Prev by Date: Re: using a shell variable in an osascript line?
  • Next by Date: Re: using a shell variable in an osascript line?
  • Previous by thread: Re: using a shell variable in an osascript line?
  • Next by thread: Re: using a shell variable in an osascript line?
  • Index(es):
    • Date
    • Thread