Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DmbShn41

macrumors 6502
Original poster
Jun 22, 2009
295
2
What is the connection between AppleScript and ObjC? I know you can use Xcode to write AppleScript, and it's ability is underrated. IS it possible to use AppleScript in place of ObjC, similiar to Lua or other languages?
 

ghayenga

macrumors regular
Jun 18, 2008
190
0
What is the connection between AppleScript and ObjC? I know you can use Xcode to write AppleScript, and it's ability is underrated. IS it possible to use AppleScript in place of ObjC, similiar to Lua or other languages?

No. There is no connection between them.
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
You can use XCode to create AppleScript Studio applications where your code is mostly in AppleScript, and you can access Obj-C code from within that script if you are willing to work at it (I did so a long time ago, but don't remember the details). Your GUI is constructed in InterfaceBuilder, almost exactly like a Obj-C project (but you don't bind it the same way).

And then there is the relatively new method of putting an AppleScript interpreter inside Obj-C, but that is more useful for interfacing with other programs through their AppleEvents handles (what AppleScript uses).

And then there are the other scripting bridges such as the ones for Python and Ruby. There you can use modules in those languages to more directly substitute for Obj-C, so long as you use the appropriate XCode template (it has some Obj-C code to set things in motion). You make and bind your GUI in the exact same way as for Obj-C (especially if you use bindings), and you can mix-and-match Obj-C and the template language very easily (although you can't use more than one language + Obj-C).

The AppleScript bridge is not quite as good as the Ruby and Python bridges. It is a bit older, but there was some talk out of Apple engineers at WWDC a year ago about that bridge being brought in line with the others, but I did not make it to this years conference to hear the latest status on that.
 

mysterytramp

macrumors 65816
Jul 17, 2008
1,334
4
Maryland
What is the connection between AppleScript and ObjC? I know you can use Xcode to write AppleScript, and it's ability is underrated. IS it possible to use AppleScript in place of ObjC, similiar to Lua or other languages?

Inside Xcode, you can call Cocoa methods using "call method," which gives you quite a bit of functionality. It's not the same as Objective C, but it is a huge leap forward. Google Applescript and "call method" and you should see quite a bit, including entries in Apple lists that will help.

mt
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX

Billy Boo Bob

macrumors 6502
Jun 6, 2005
493
0
Dark Side Of The Moon
The AppleScript bridge is not quite as good as the Ruby and Python bridges. It is a bit older, but there was some talk out of Apple engineers at WWDC a year ago about that bridge being brought in line with the others, but I did not make it to this years conference to hear the latest status on that.

It looks like they're going to make it happen with Snow Leopard. Right now AppleScript Studio is totally left out of SL's Dev Tools, and the AppleScript bridge appears to be there (at least partially?), but the docs are not accessible unless you're a qualified dev (to download them).

So I've been told. :D
 

larkost

macrumors 6502a
Oct 13, 2007
534
1
It looks like they're going to make it happen with Snow Leopard. Right now AppleScript Studio is totally left out of SL's Dev Tools, and the AppleScript bridge appears to be there (at least partially?), but the docs are not accessible unless you're a qualified dev (to download them).

So I've been told. :D

I can tell you that you have been told wrong, but can't say how (sorry, NDA). I am still missing the information that is important to me, but I can't get that either (someone else told me: "sorry, NDA").
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.