• 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
osascript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

osascript


  • Subject: osascript
  • From: Simon Forster <email@hidden>
  • Date: Thu, 25 Jul 2002 20:17:14 +0100

Can anyone tell me why the shell script snippet:

#!/bin/sh
osascript -e 'tell application "'$1'" to activate'

fails when passed a two word argument from the command line but works fine with a one word argument. I've tried echoing it back to the terminal and it all looks absolutely fine such as:

osascript -e tell application "TextEdit" to activate

and

osascript -e tell application "Address Book" to activate

are echoed back. If I try too run it, the first version works fine, the second doesn't - it fails with "syntax error: Expected string but found end of script. (-2741)".

I'm sure I'm missing something simple.

TIA

Simon Forster
________________________________________________
LDML Ltd, 4/5 Hazlitt Mews, London, W14 0JZ, UK
<tel int="+44 70 9230 5244" uk="070 9230 5244">
<fax int="+44 70 9230 5247" uk="070 9230 5247">
<mailto:email@hidden>
________________________________________________
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: osascript
      • From: Christopher Nebel <email@hidden>
    • Re: osascript
      • From: Russ <email@hidden>
  • Prev by Date: Trapping for a network error
  • Next by Date: RE: Force quiting URL Access Scripting
  • Previous by thread: Trapping for a network error
  • Next by thread: Re: osascript
  • Index(es):
    • Date
    • Thread