Folks;

I'm trying to do something that seems like it should be easy, but I'm stymied by what I think is a permissions error I don't understand.

I'm trying to run a script using NSTask.
I have the static script stored as a separate file in my bundle.
I have created a folder in my "Applications Support" directory called "Scripts" and copied my script and several items into this directory.
Note that this has a space in the full pathname!

SO I have tried the following:
NSString *myScriptPath = [[self scriptsFolderPath] stringByAppendingPathComponent:@"myUseful.script"]; //yes I have verified this is a valid path!!!
NSTask *task = [[[NSTask alloc] init] autorelease];
[task setLaunchPath: myScriptPath];
[task setArguments:[NSArray arrayWithObject:...]];
[task setStandardInput:[NSPipe pipe]];
[task launch];

ERRROR: launch path not accessible

So, thinking that the 'space' maybe wanking out the 'setLaunchPath' I tried to convert to a 'safe' url path:
NSURL *myScriptFileURL = [NSURL fileURLWithPath:t];
...
[task setLaunchPath:[myScriptFileURL absoluteString]];

Same error!

The docs don't make it clear TO ME why I would need special permissions to launch a script in my own "App Support" directory.
Am I out in the weeds chasing the wrong rabbits?

Any guidance appreciated!
Steve



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to