1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

AppleScript - ObjC: Whats the connection?

Discussion in 'Mac Programming' started by DmbShn41, Jul 12, 2009.

  1. macrumors 6502

    #1
    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?
     
  2. macrumors regular

    #2
    No. There is no connection between them.
     
  3. macrumors P6

    -aggie-

    #3
    No, you can't use AppleScript in place of ObjC.
     
  4. Moderator emeritus

    kainjow

    #4
    Well not yet at least ;)
     
  5. macrumors 6502a

    #5
    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.
     
  6. macrumors 65816

    mysterytramp

    #6
    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
     
  7. macrumors 68040

    lee1210

    #7
    You can go the other way with NSAppleScript:
    http://developer.apple.com/document.../NSAppleScript_Class/Reference/Reference.html

    -Lee
     
  8. macrumors 6502

    Billy Boo Bob

    #8
    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
     
  9. macrumors 6502a

    #9
    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").
     

Share This Page