Guess Media: Internet & Web — Media & Development Studio

Thursday November 20th, 2008

[ Home ]—[ About | Contact | Press | Login | Help ]—[ Research | Development | Services | Portfolio ]—[ Kids | Fun | MySpace | Scratch | Tech | NMOX ]
GuessMedia.comDevelopmentExplore › AppleScript

AppleScript

“To create a new standard, it takes something that’s not just a little bit different; it takes something that’s really new and really captures people’s imagination — and the Macintosh, of all the machines I’ve ever seen, is the only one that meets that standard.” — Bill Gates

“Just like VBA, AppleScript sucks. I think it sucks differently, but it sucks nonetheless.” — rjbs


Findings

Having evaluated AppleScript’s usefulness as a development language, I have determined that it isn’t. (Useful). At all. There are deep flaws in the AppleScript Studio implementation, leading to inconsistent and frustrating results. Apple’s own example files for learning AppleScript in Xcode have comments within the code from the author acknowledging buggy behavior and lamenting a lack of information as to WHY it behaves the way it does. I am personally making these observations having just wasted a whole night trying to debug two applications that have IDENTICAL CODE; one works, one does not. I literally did a cut and paste, set up within a controlled and identical test environment. Nope. If you are planning on developing for the Mac, I would not use AppleScript for anything more than a one–or–two–line tool for giving some very basic instructions to the OS, and that only if you were previously aware of the proper command in AppleScript and are having great difficulty finding the equivalent functionality within Objective-C / Cocoa. Honestly. Don’t use it. It’s like eating the display food restaurants set out to entice you to come in for a meal. You CAN eat it, but it tastes like plastic and makes you want to hurl. The real stuff is inside, has been recently prepared, and is fit for enjoyable consumption. OUTSIDE of Xcode, namely within Script Editor, AppleScript is a very cute and useful means of customizing your Mac experience. I plan to refrain from purging its syntax from my memory on the basis that once in a while it might come in handy for small workflow tasks requiring a very few lines of script. Just don’t plan on doing any actual software development with it. I warned you, k?

Description

AppleScript is the language Mac users learn when they want to customize their workflow with greater flexibility than that provided by Automator. With the release of OSX and Xcode, Mac developers can even use AppleScript to create full–blown native applications for OSX.

AppleScript looks like English, for the most part. Here is a script you can use to hide all applications except for the Finder:

        
        tell application "System Events" to set visible of every process
                whose name is not "Finder" to false
        
    

Please note: the syntax for Script Editor and AppleScript Studio (read: Xcode) is a bit different. I will only be looking at Script Editor stuff, as with this above code example.


AppleScript Resources


[ ../ ]

Get Firefox :: Get Thunderbird :: Get Flash :: Get Adobe Reader :: Get Quicktime :: Get Java :: Get Limewire :: Get Real :: Get Paid :: Get Services ]
©2005–2008 David, Aeysha, & Tegan :: Some Rights Reserved :: Powered by PacketCafe :: Disclaimers :: Privacy :: Site Map :: Site Search :: Κολοφων