PDA

View Full Version : Open external apps through cocoa code...




dhumphries
Aug 24, 2007, 04:40 PM
Hey,

In an app i'm developing, I need to be able to click a button and an external app is opened (like mail or iphoto etc...)

Any ideas what the code to do this is?

Cheers,
D Humphries



Eraserhead
Aug 24, 2007, 06:03 PM
You can call an applescript using NSApplescript to do it, alternatively you may be able to use NSWorkspace.

dhumphries
Aug 24, 2007, 06:45 PM
You can call an applescript using NSApplescript to do it, alternatively you may be able to use NSWorkspace.

Hey, thanks for the reply. But could you explain in a bit more detail? I'm not that great at cocoa yet.

Cheers,
D Humphries

robbieduncan
Aug 24, 2007, 07:27 PM
I'd suggest the very obvious method in the documentation (http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWorkspace/launchApplication:).

dhumphries
Aug 24, 2007, 08:30 PM
I'd suggest the very obvious method in the documentation (http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWorkspace/launchApplication:).

Ah, thanks a lot