Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jason Coco
Yeah, to me it is... although I still agree that it's not an ideal solution for a Cocoa application... By the way, assuming you change char *args[] = { -a, Safari, NULL }; to char *args[] = { /usr/bin/open, -a, Safari, NULL }; the exec* example actually works while the LaunchServices

exec(uting) Safari - How (newbie)

2008-07-01 Thread Barrie Green
Hi all, I want to write a quick little cocoa app that fires off Safari. I started with something like int main(int argc, char* argv[]) { ... ... if(execv(/Applications/Safari.app, someArgs) == -1) { NSLog(@execv failed with %s, strerror(errno)); } } It always fails with 'Permission

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Kristopher Matthews
Try executing /Applications/Safari.app/Contents/MacOS/Safari. /Applications/Safari.app identifies a bundle, not the actual application (and execv() is not aware of bundles). --Kris On Jul 1, 2008, at 10:15 AM, Barrie Green wrote: Hi all, I want to write a quick little cocoa app that

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Marcelo Alves
Why not use [NSWorkspace launchApplication:] method? http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWorkspace/launchApplication: 2008/7/1 Barrie Green [EMAIL PROTECTED]: Hi all, I want to write

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Jason Coco
You could also use /usr/bin/open -- then you wouldn't have to know where safari lives. execl(/usr/bin/open, /usr/bin/open, -a, Safari, 0); On Jul 1, 2008, at 11:19 , Kristopher Matthews wrote: Try executing /Applications/Safari.app/Contents/MacOS/Safari. /Applications/Safari.app identifies

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Kyle Sluder
On Tue, Jul 1, 2008 at 11:30 AM, Jason Coco [EMAIL PROTECTED] wrote: You could also use /usr/bin/open -- then you wouldn't have to know where safari lives. Abaddesignsayswhat? What do you think open uses anyway? ;-) ___ Cocoa-dev mailing list

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Andrew Merenbach
On Jul 1, 2008, at 8:15 AM, Barrie Green wrote: Hi all, I want to write a quick little cocoa app that fires off Safari. I started with something like int main(int argc, char* argv[]) { ... ... if(execv(/Applications/Safari.app, someArgs) == -1) { NSLog(@execv failed with %s,

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Ilan Volow
Another option (which may or may not work for you) is embedding a WebKit view in your application window and using that to display web stuff. -- Ilan On Jul 1, 2008, at 11:15 AM, Barrie Green wrote: Hi all, I want to write a quick little cocoa app that fires off Safari. I started with

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Gregory Weston
Barrie Green wrote: Hi all, I want to write a quick little cocoa app that fires off Safari. ... Ideally I would like to run the app without it asking me for my password, how could I achieve that? Considering that I can think of no common purpose for launch Safari that doesn't continue

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Clark Cox
On Tue, Jul 1, 2008 at 11:04 AM, Gregory Weston [EMAIL PROTECTED] wrote: Barrie Green wrote: Hi all, I want to write a quick little cocoa app that fires off Safari. ... Ideally I would like to run the app without it asking me for my password, how could I achieve that? Considering that

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Kevin Elliott
On Jul 1, 2008, at 8:53 AM, Kyle Sluder wrote: On Tue, Jul 1, 2008 at 11:30 AM, Jason Coco [EMAIL PROTECTED] wrote: You could also use /usr/bin/open -- then you wouldn't have to know where safari lives. Abaddesignsayswhat? What do you think open uses anyway? ;-) With out looking at

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Kyle Sluder
On Tue, Jul 1, 2008 at 8:17 PM, Kevin Elliott [EMAIL PROTECTED] wrote: Of course, they're both bad choices. As several people have pointed out, NSWorkspace launchApplication or openURL depending on the requirements. If it's not possible to use NSWorkspace (i.e. because you can't link against

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Jason Coco
What env pollution? I agree that exec* isn't really the way to go, but that's what the OP was using... I just suggested that /usr/bin/open is a better option than hard-coding the path to some arbitrary application. It's also a lot easier to use than the LaunchServices API... although if I