MacTech Article > Migrating AppleScript Studio Apps to AppleScriptObjC (Cocoa-AppleScript)

For years, AppleScript Studio provided scripters with a framework, through Xcode and Interface Builder, for implementing Cocoa interfaces in AppleScript-based apps. When it comes to AppleScript, end users are often accustomed to faceless apps that simply run when launched and quit when finished, with minimal feedback along the way. AppleScript Studio gave developers the power to implement feature-rich and user-friendly interfaces, which allowed users to configure script behavior, displayed progress during processing, and gave scripts the look and feel of virtually any other OS X app.

In August of 2009, Apple released Snow Leopard (OS X 10.6). At the same time, AppleScript Studio was deprecated and its official replacement, AppleScriptObjC, also known as Cocoa-AppleScript, was announced. AppleScriptObjC provides all of the benefits of AppleScript Studio, but with numerous additional benefits such as the ability to integrate scripts with any Cocoa framework in OS X.

Today, in Mountain Lion (OS X 10.8), Xcode no longer supports AppleScript Studio. Xcode includes project templates for creating AppleScriptObjC apps, but all references to AppleScript Studio are long gone. For long-time AppleScript Studio developers, this raises some core questions about supporting and migrating existing apps.

[Read the full article in MacTech magazine's March 2013 issue, available in print and in the MacTech iPad Newsstand app]

 

Peachpit Article > Building a Basic AppleScriptObjC (Cocoa-AppleScript) Application with Xcode

In OS X Mountain Lion, AppleScript continues to be a powerhouse tool for controlling applications on the Mac. Whether you need to automate the creation of a few folders in the Finder, or generate a several-hundred-page product catalog in Adobe InDesign, AppleScript is waiting to lend a hand. Despite AppleScript's learning curve, Mac users everywhere are using it on a daily basis, and it saves time and money that might otherwise be wasted.

 AppleScripts aren't known for having slick interfaces. Perhaps most often, these scripts are written as simple applications, using the AppleScript Editor (found in/Applications/Utilities). When you double-click the application, it launches, performs some series of hidden tasks, and then quits. Developing script applications that work like this is quick and easy if you have the know-how, but if you're planning to distribute your script to other people, this format isn't always ideal. For one thing, aside from displaying simple dialog messages, you have no real way to let users know what your script is doing. Furthermore, unless users are AppleScript-savvy, there's no way for them to adjust the behavior of your script.

AppleScriptObjC (also called Cocoa-AppleScript) is an advanced method of developing AppleScript-based native Cocoa applications. With AppleScriptObjC, you can develop rich user interfaces and interact with them directly from your scripts. [Read more on the Peachpit.com...]

MacScripter AppleScript Studio Article > Getting Started with AppleScript Studio

Getting Started with AppleScript Studio.

Over the past several months, we have been discussing command handlers and subroutine handlers in detail. This month, we will begin discussing a new topic ... AppleScript Studio. As we proceed, you will find that we will be using handlers regularly, especially command handlers, as AppleScript Studio makes heavy use of them. [Read more at MacScripter...]

MacScripter AppleScript Studio Article > Getting Started Using Tab Views in AppleScript Studio

Getting Started Using Tab Views in AppleScript Studio.

Creating AppleScript Studio applications complete with interfaces is a great way to make your scripts user friendly, and allow users to specify information that affects how your script will behave.  However, when lots of options are necessary, an interface can quickly become cumbersome.  This is where tab views can become very handy.  A tab view can allow you to organize your interface elements into structured groups of common elements, which can be navigated by a user selecting the appropriate tab. [Read more at MacScripter...]

MacScripter AppleScript Studio Article > Getting Started with Table Views

Getting Started with Table Views.

In this month's column, we're going to discuss a specific type of interface element that is often incorporated into AppleScript Studio projects' a table view. Table views consist of one or more cells (displayed using columns and rows), which may be used to display data. Think of a table view as being similar in layout to a worksheet in Excel. See figure 1 for an example of a 2-column table view in an AppleScript Studio project's interface. [Read more at MacScripter...]

MacScripter AppleScript Studio Article > Getting Started with Displaying Progress in AppleScript Studio

Getting Started with Displaying Progress in AppleScript Studio.

One very common use for AppleScript is batch processing. Scripts of this nature will often loop through multiple items, performing some type of automated task for each item being processed. An example of this might be a script that loops through a folder of image files, converting each one to another format.

A script of this nature that is created with Script Editor, and then run, may work just fine. However, visually, it is less than spectacular. Other than a spinning cursor, and perhaps a dialog message displayed here or there during script execution, the user does not usually receive a very good visual representation of what is occurring.

This is where AppleScript Studio can come in handy. In this month's column, we will discuss adding progress bars and spinners to an AppleScript, in order to provide a visual representation of what is being processed, how much processing is complete, and how much processing remains during script execution. [Read more at MacScripter...]

MacScripter AppleScript Studio Article > Getting Started with Buttons in AppleScript Studio (Part 2)

Getting Started with Buttons in AppleScript Studio (Part 2).

When designing an interface in AppleScript Studio, you will find that different situations call for different types of buttons.  In last month's column, we focused on two specific types of buttons, push buttons and popup buttons (click here for last month's column).  This month, we're going to discuss two more specific types of buttons, checkboxes and radio buttons. [Read more at MacScripter...]

MacScripter AppleScript Studio Article > Getting Started with Buttons in AppleScript Studio (Part 1)

Getting Started with Buttons in AppleScript Studio (Part 1).

Last month, we began discussing how to get started with using AppleScript Studio (click here for last month's column).  In the column, we covered creating an AppleScript Studio project in Xcode, designing a user interface, linking the interface to AppleScript code within the project, and building and running the completed project.

This month, we are going to continue to work with AppleScript Studio. Specifically, we will be focusing on interacting with buttons.

There are many different styles of buttons in AppleScript Studio, including push buttons, popup buttons, checkboxes, radio buttons, and more.  In addition to varying visually in appearance, the code you will write to interact with different buttons will vary too, depending on the button type.  We are going to begin by exploring two of the more commonly used styles of button -- push buttons and popup buttons. [Read more at MacScripter...]

MacTech AppleScript Essentials Column > Providing Progress Feedback During Script Execution

January, 2006 - Providing Progress Feedback During Script Execution.

Many AppleScripts do not provide progress updates to the user during processing. Most of the time, when a script is run, it simply performs the appropriate tasks "behind the scenes," so to speak. If run as an application, a script may appear in the Dock when launched. However, this hardly provides detailed information to the user about what is actually occurring. Sometimes, a script may not need to provide progress updates to the user. However, there are situations when providing such feedback is a good idea.

In this month's column, we will walk through the process of creating a script that will provide visual progress information to the user during processing. The script we will create will save selected email messages in Mail as text files into a user-specified output folder. Since the script will have the ability to process multiple selected email messages, we will write our code to provide a visual indication to the user of which message is currently being processed. Once you learn how to provide this type of feedback, then you can begin integrating this same technique into your other scripts, making them more user friendly. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Building Table Views with AppleScript Studio

December, 2005 - Building Table Views with AppleScript Studio.

Back in my April column, I provided an introduction to AppleScript Studio, a technology that is a part of Xcode and Interface Builder, Mac OS X's powerful integrated development environment. Using AppleScript Studio, AppleScript developers are able to create fully native Mac OS X applications, complete with user interfaces. By constructing scripts with interfaces, developers can build complex and powerful user friendly AppleScript solutions that have the same look and feel of any other Mac OS X application.

In addition to building stand-alone AppleScript solutions, AppleScript Studio can also now be used to create Automator actions, for use with Mac OS X 10.4's popular new Automator application. In my August column, I walked through the process of building of a simple AppleScript Studio-based Automator action.

This month, we will create a new AppleScript Studio-based project that is a little more complex, and incorporates a table view into its interface. This application, which I call Enable|Disable Mail Accounts, will display a list of email accounts in Mail to the user, and allow the user to toggle whether the accounts are enabled or disabled. [Read more at MacTech.com...]