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

using a shell variable in an osascript line?


  • Subject: using a shell variable in an osascript line?
  • From: LuKreme <email@hidden>
  • Date: Thu, 26 Feb 2009 23:43:58 -0700

I have a shell variable that I set to the output of a shell command

VAR1=`tail -1 /var/log/maillog`

and then I use VAR1 in the shell script for various things.

Then, at some point, I want to use that VAR1 in an osascript line, maybe something like:

   osascript -e "display dialog $VAR1"

this doesn't work, however. the variable is transient in nature, so I can't simply redo the assignment as a do shell script.

Do I have to do

   osascript -e "display dialog (do shell script \"echo $VAR1\")"

which while it works, is fugly to behold, or is there a better option I'm missing?

--
"It's unacceptable to think" - George W Bush 15/Sep/2006

_______________________________________________
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: Doug McNutt <email@hidden>
    • Re: using a shell variable in an osascript line?
      • From: Matthew Smith <email@hidden>
    • Re: using a shell variable in an osascript line?
      • From: Skeeve <email@hidden>
    • Re: using a shell variable in an osascript line?
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: Re: Adobe Illustrator CS3 placing a linked PDF image, cropping to bounding box
  • Next by Date: Re: using a shell variable in an osascript line?
  • Previous by thread: Re: Scripts or example scripts for Pages?
  • Next by thread: Re: using a shell variable in an osascript line?
  • Index(es):
    • Date
    • Thread