Slashdot Mirror


Apple Previews New Script Editor

DrC writes "Apple has released a preview update to the venerable Script Editor, rewritten using Cocoa. It looks like an impressive upgrade." The preview release is included with the Dec 2002 Developer Tools as a separate install, too.

7 of 21 comments (clear)

  1. Re:The editor? by brotherash · · Score: 2, Informative

    Why do we need a "replacement" for Perl? Why not let AppleScript do what it is good for and let Perl do the heavy lifting?

  2. Re:Advantages of AppleScript over sh, awk, sed, et by xmath · · Score: 5, Informative
    AppleScript is a scripting language layered on top of AppleEvents, which is basically an object-oriented IPC system. This means that if an application properly supports appleevents, then you can fully control an application via applescript, rather than programatically frob the UI.

    For example, it's valid to say:

    tell application "Finder" to duplicate the selection to folder "Foo" of home

    if you run this, it'll copy whatever you have selected in the Finder to ~/Foo

    The downside is that you have to rely on the developer of the application you want to control to have created the proper hooks.

  3. Re:Advantages of AppleScript over sh, awk, sed, et by xmath · · Score: 5, Informative

    Oh, and another reason is that there are various applications with good AppleScript integration, notable the Finder. For example, you can create "Folder actions", which are scripts that are automatically executed when you open a folder, or drag something into it etc.

    One more thing I should note is that the underlying system (OSA) is quite flexible. In particular, an applications "dictionary" (which contains a description of all objects reachable via IPC and their properties etc) is fairly language-agnostic. It's for example probably possible to write a perl OSA-plugin, which would allow the user to use the Script Editor to write an run perl scripts to control applications via AppleEvents. In fact, if the plugin has handlers for converting AEs to script, the user can "record" scripts. (the system intercepts AEs caused by manual user actions, and translates them into script. pretty cool)

    So there's more to AppleScript than meets the eye. See also Inside Macintosh: InterApplication Communication and other AE/AS/OSA related docs.

  4. Re:The editor? by Slur · · Score: 5, Informative

    AppleScript itself is being constantly updated, as you would know had you read the release notes for the latest OS upgrade. Meanwhile, perl is included with the operating system and there are two different perl-Aqua bridging technologies currently under development, one by Apple and another by an independent effort. And if you look further you will discover that you can call perl / shell scripts from AppleScript, and you can invoke AppleScript from perl / shell scripts. Thus you have the best of all worlds with Mac OS X.

    As a general guideline, when you aren't aware of what's going on you should post questions, not statements.

    --
    -- thinkyhead software and media
  5. Other Applescript news by fordgj · · Score: 3, Informative

    This is one among some other applescript goodies that have been announced. Interestingly, thye are releasing GUI interaction, something that was previously only available via third party tools like Prefab Player. Also, if you look in the new player, there is a setting for which language to use. Thus, there is the flexibility to use other languages (fronteir?).

  6. applescripting csh and csh'ing applescript by ubiquitin · · Score: 4, Informative

    Don't forget that you can put AppleScripts into shell scripts via the "open" command and vice versa you can call shell scripts from AppleScript by opening a terminal session for them, i.e., executing a .term file.

    There's no need to bicker about scripting languages when they can call each other.

    It's all good.

    What the world needs is fewer karma whores and more good friends.
    Go ahead, friend. :) Click that white button and turn it green.

    --
    http://tinyurl.com/4ny52
    1. Re:applescripting csh and csh'ing applescript by Cantus · · Score: 4, Informative
      Even better, you can execute AppleScript commands directly from a shell script with the "osascript" command. Check man osascript.

      And the reverse is also possible: executing shell scripts directly from AppleScripts using the "do shell script" command.