• 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: shell script in AppleScript ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell script in AppleScript ?


  • Subject: Re: shell script in AppleScript ?
  • From: Rob Keniger <email@hidden>
  • Date: Fri, 18 Jan 2008 16:01:00 +1000


On 18/01/2008, at 3:50 PM, Caroline wrote:

I'm using NSAppleScript & "do shell script" in my Cocoa App.
But, I have some problems.

In Terminal,
script is -> cmd option "Picture 1" "Picture 2".
It is good.

But in cocoa App,
script is -> NSString *sCmd = @"cmd option \"Picture 1\" \"Picture 2\";
NSAppleScript *script = [NSAppleScript alloc] initWithSource: [NSString strintWithFormat:@"do shell script %@",sCmd]];
Using '\"' because whitespace. (between Picture and 1)


It has error.
(NSAppleScriptErrorMessage : "A identifier can\U2019t go after this \U201c\"\U201d.";)


How can I deal whitespace?


You should be using NSTask if you want to run shell scripts with your Cocoa application. Is there a reason you want to use AppleScript?

--
Rob Keniger
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >shell script in AppleScript ? (From: Caroline <email@hidden>)

  • Prev by Date: shell script in AppleScript ?
  • Next by Date: Implementing Leopard features with Tiger compatibility
  • Previous by thread: shell script in AppleScript ?
  • Next by thread: Re: shell script in AppleScript ?
  • Index(es):
    • Date
    • Thread