PDA

View Full Version : Good Time For Applescript?


Nick
2005.06.12, 10:33 AM
I'm making buttons that take the user to my website and to iDevGames. They are plain NSButtons and I'm making it all with interface builder. Should I use Applescript to get this functionality or is there an easier/better way? If applescript, how would I do this? I've never used it before in apps, just little scripts that just open websites when run.

Andrew
2005.06.12, 11:27 AM
Well, if this is a Cocoa app, you can skip the applescript and go straight to NSWorkspace (http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSWorkspace.html#//apple_ref/doc/uid/20000391-BCIBBHIG). For example,

[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.google.com"]];