• 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: Launch Path Not Accessible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch Path Not Accessible


  • Subject: Re: Launch Path Not Accessible
  • From: Andrew Farmer <email@hidden>
  • Date: Sat, 2 Aug 2008 13:26:18 -0700

On 02 Aug 08, at 13:01, Steve Cronin wrote:
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

Are you sure myUseful.script is directly executable? Just because it's double-clickable in the Finder doesn't mean it's executable... if this is an AppleScript, though, you may have better luck working with NSAppleScript.


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]];

Nope. NSTask takes a filesystem path, not a URL. _______________________________________________

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


  • Follow-Ups:
    • Re: Launch Path Not Accessible
      • From: Steve Cronin <email@hidden>
References: 
 >Launch Path Not Accessible (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: Non-editable TableView and the Evil NSEditorBinder
  • Next by Date: Re: how to release my window controller
  • Previous by thread: Launch Path Not Accessible
  • Next by thread: Re: Launch Path Not Accessible
  • Index(es):
    • Date
    • Thread