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

NSTask is Weird


  • Subject: NSTask is Weird
  • From: "J. Todd Slack" <email@hidden>
  • Date: Wed, 10 Sep 2008 20:24:40 -0700

Hi All,

NSTask seems weird to me.

I am trying to call a command-line app with arguments.

When I execute in a Terminal it works, but from my application is fails.

Here it the command I am executing:

/usr/local/bin/pymp3cut --segment "/Users/slack/Library/Application Support/Ring-Maker/tmp/amber",00:00:11,00:00:36 "/Users/slack/Music/ iTunes/iTunes Music/311/Unknown Album/01 Amber.mp3"

I get this from the debugger console:

2008-09-10 20:18:20.242 Ring-Maker[4174:10b] An exception was thrown during execution of an NSScriptCommand...
2008-09-10 20:18:20.242 Ring-Maker[4174:10b] launch path not accessible


Here is what I am doing:

NSString *strArguments = [NSString stringWithFormat: @"%@%@%@%@%@%@%@%@ %@%@%@%@%@",
@"--segment",
@" ",
@"\"",
ringToneNameMP3Path,
@"\"",
@",",
startStr,
@",",
endStr,
@" ",
@"\"",
path,
@"\""
];


/* take all the pieces and build up command for NSTask */
arguments = [NSArray arrayWithObjects: strArguments, nil];

[task setLaunchPath: @"/usr/local/bin/pymp3cut"];
[task setArguments: arguments];
[task setStandardOutput: pipe];

[task launch];


In the debugger it shows:
/usr/local/bin/pymp3cut --segment "/Users/slack/Library/Application Support/Ring-Maker/tmp/amber",00:00:11,00:00:36 "/Users/slack/Music/ iTunes/iTunes Music/311/Unknown Album/01 Amber.mp3"


Which looks right.

Any thoughts?

-Jason





_______________________________________________

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: NSTask is Weird
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: BOOL array
  • Next by Date: How to locate error that occurs while the nib is loading
  • Previous by thread: Re: How do people typically implement dialog controllers?
  • Next by thread: Re: NSTask is Weird
  • Index(es):
    • Date
    • Thread