Learning AppleScript

Discussion in 'Mac Programming' started by Aperture, Nov 30, 2007.

  1. Aperture macrumors 68000


    Mar 19, 2006
    I've been learning Visual Basic and I think it is really fun except I'd prefer to know a Mac language. Are there any resources out there that are straightforward for learning AppleScript?

    Is AppleScript even the best Mac equivalent to VB? Is the coding at all similar?

  2. kainjow Moderator emeritus


    Jun 15, 2000
    It's not equivalent at all really. The only equivalent is REALbasic but if you're serious about Mac programming learn Objective-C/Cocoa.
  3. mduser63 macrumors 68040


    Nov 9, 2004
    Salt Lake City, UT
    It's really not that similar. They're both meant to be relatively easy to use, but AppleScript is much more focused on scripting/automating other applications rather than writing apps from scratch (although you can write apps entirely in AppleScript too). Not a bad thing to learn, but don't expect your VB knowledge to transfer over much. You might check out RealBasic.
  4. hhas macrumors regular

    Oct 15, 2007
    As other folks say, REALbasic is the nearest equivalent to VB if that's what you're looking for. It's a commercial product, but has the advantage of cross-platform support and its similarity to VB should make most of your VB knowledge transferable.

    If you really want to learn AppleScript and already know a bit of programming, get yourself a copy of Matt Neuburg's AppleScript: The Definitive Guide. Be aware though that AppleScript is a somewhat flawed language and pretty much a one-trick pony, so unless your only interest is application automation you're probably better off going with a more general-purpose scripting language such as Python or Ruby.

    Personally I prefer Python, but both languages are pretty decent and have excellent documentation, library and community support. They're also cross-platform, with extensive Cocoa and application automation support available on the Mac side, and similar options on the Windows side.

  5. Doctor Q Administrator

    Doctor Q

    Staff Member

    Sep 19, 2002
    Los Angeles
    AppleScript is a rather unusual programming language. Its syntax is very flexible in some areas (it tries very hard to look like English) and very picky in others. It's very powerful in some areas and feels primitive in others.

    It's one of those languages where it's easy to read a program, but often hard to write one.

    The best way I found to learn it was with a good book, some online guides, plenty of experimenting, and wholesale theft of examples people have posted, to use as a starting point for your own programs.

    With some languages, I can write a program from start to finish and it is likely to work. With AppleScript, I always seem to need a bit of trial and error, but that's partly because I use it only when I want to do some little task, and I haven't taken the time to fully master it.
  6. Aperture thread starter macrumors 68000


    Mar 19, 2006
    I'm not necessarily opposed to learning a new language - I just wanted the best Mac equivalent to VB.

    I'd rather not learn RealBasic as I think it would be better to start fresh with a new language and I'd prefer to use free coding tools.

    Which is the best language to start with on the Mac? (To write real applications, not just automation scripts) Objective-C?

    Is there a good book that is easy to follow for learning ____ language? Please post your recommendations!

    Thanks Again

Share This Page