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

2008-07-02 Thread Clark Cox
On Wed, Jul 2, 2008 at 8:46 AM, Jason Coco <[EMAIL PROTECTED]> wrote: > > On Jul 2, 2008, at 11:38 , Clark Cox wrote: > >> On 7/2/08, Jason Coco <[EMAIL PROTECTED]> wrote: >>> >>> Yeah, to me it is... although I still agree that it's not an ideal >>> solution for a Cocoa application... >>> >>> By t

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

2008-07-02 Thread Jason Coco
On Jul 2, 2008, at 11:38 , Clark Cox wrote: On 7/2/08, Jason Coco <[EMAIL PROTECTED]> wrote: 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[] = { "/us

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

2008-07-02 Thread Jason Coco
On Jul 2, 2008, at 11:36 , Jean-Daniel Dupas wrote: Le 2 juil. 08 à 16:58, Jason Coco a écrit : 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[]

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

2008-07-02 Thread Clark Cox
On 7/2/08, Jason Coco <[EMAIL PROTECTED]> wrote: > 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 }; > t

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

2008-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 08 à 16:58, Jason Coco a écrit : 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 exe

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 LaunchServi

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

2008-07-02 Thread Jean-Daniel Dupas
"a lot easier than Launch Services" ? extern char **environ; char *args[] = { "-a", "Safari", NULL}; execve("/usr/bin/open", args, environ); versus: FSRef app; if (noErr == LSFindApplicationForInfo(kLSUnknownCreator, NULL, CFSTR("Safari"), &app, NULL)) LSOpenFSRef(&app, NULL); Le

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 w

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 agai

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 t

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?

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 w

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 s

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", strerro

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 (C

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 i

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

2008-07-01 Thread Marcelo Alves
Why not use [NSWorkspace launchApplication:] method? 2008/7/1 Barrie Green <[EMAIL PROTECTED]>: > Hi all, > > I want to

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 fir

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 'Permiss