• 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: Skeeve <email@hidden>
  • Date: Fri, 27 Feb 2009 22:00:26 +0100

Matthew Smith schrieb:
I am on Leopard.
Strange.

You need the variable to be defined otherwise it will return nothing.
I'm not stupid ;-)

 osascript -e 'return system attribute "TMPDIR"'

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

It's not sufficient to have the variable defined!

$ echo "echo: $var1" ; osascript -e 'return "osa: " & system attribute "$var1"'
echo: xx "aa" cc
osa:


You need to export it:
$ export var1 ; echo "echo: $var1" ; osascript -e 'return "osa: " & system attribute "var1"'
echo: xx "aa" cc
osa: xx "aa" cc



But I'm on Tiger.

_______________________________________________
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: "Mark J. Reed" <email@hidden>
References: 
 >Re: using a shell variable in an osascript line? (From: Matthew Smith <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