Re: shell script in AppleScript ?
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