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...]

MacTech AppleScript Essentials Column > Introduction to Scripting iCal

November, 2005 - Introduction to Scripting iCal.

For the past couple of articles, I have discussed scripting specific applications. By now, you should be starting to realize AppleScript terminology varies from application to application. Some applications don't support AppleScript at all, some are more scriptable than others, some have more confusing terminology, etc. Even as become more knowledgeable as a scripter, you will find that there is a learning curve whenever you need to script a new application. Browsing the application's dictionary, and any accompanying documentation or example scripts is usually your best bet for learning how to script a new application.

This month, I will continue to discuss application-specific scripting, and this time, I will focus on iCal. Please note that all sample code within this article was written and tested with Mac OS X Tiger 10.4.x. Many times, software updates will introduce changes in the AppleScript terminology of a given application or process. Therefore, if you are using an older system, some code may not work properly, or may need to be adjusted slightly to work on your machine. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Introduction to Scripting Address Book

October, 2005 - Introduction to Scripting Address Book.

If you have a large number of contacts in your contact management application, then you are probably already aware that maintaining your existing contacts, adding new ones, removing outdated ones, etc., can quickly become a time consuming process. Yet again, AppleScript is ready to come to your rescue. Using AppleScript and Address Book in Mac OS X, you can begin to automate the process of adding and removing contacts, creating groups, and even more.

Throughout this article, we will discuss a number of techniques for automating aspects of Address Book in Mac OS X. Once you have an understanding of these basic techniques, you can begin combining them together, in order to automate your contact management workflow on a larger scale. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Introduction to Scripting Mail

September, 2005 - Introduction to Scripting Mail.

Email automation is usually popular among AppleScript developers using Mac OS X. By writing scripts to perform email-related processes, developers can automate processes such as sending batches of recipient-customized messages, archiving emails in text format or in a database, emailing status reports to administrators, and much more.

In this month's article, we will discuss using AppleScript to automate aspects of the Mail application, which comes pre-installed with OS X. If you don't use the Mail application, then you may want to explore some of the many other scriptable email clients and tools that are available for the Mac. Some of these will be mentioned later in this article. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Building Automator Actions with AppleScript

August, 2005 - Building Automator Actions with AppleScript.

There has been a lot of excitement in the developer community around the release of Mac OS X 10.4. Unique technologies like Automator, Dashboard, and Spotlight are providing new opportunities for Mac developers to build unique tools that appeal to users everywhere. This month, we are going to walk through the process of developing for one of these great new technologies, Automator.  [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Working with Text

July, 2005 - Working with Text.

When writing AppleScript code, many of the things that you will automate will involve working with and manipulating text in some manner. For example, you might need to write a script that will retrieve text content from a FileMaker Pro database, and then place that content into an Adobe InDesign document. You may need to maintain a text-based log file of your script's activity during processing, or you may need a script that will extract content from email messages, and write the content to files on a server.

During this month's article, we will discuss a number of ways to work with text, including ways to break text apart, search text, and read from and write to files. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > User Interface Scripting

June, 2005 - User Interface Scripting.

As we have seen in the past, AppleScript is a great tool for creating some pretty amazing automated workflows. When implementing an AppleScript-based workflow, you are really only limited by your imagination, and by the AppleScript support that is available in the applications that you want to automate.
Many scriptable applications offer enough AppleScript support for the types of tasks that you would want to automate the most. However, at times, you may find yourself needing to script an application with limited AppleScript support, and that one task you really need to automate just is not accessible through scripting. Or, worse yet, the application you want to automate is not scriptable at all!

How do you handle these limitations? Do you simply give up? I think not. For starters, you might check around to see if there are other scriptable applications that can be substituted to automate the same task.

Another option is to consider trying to automate the application by writing AppleScript code that interacts directly with the application's interface itself. Fortunately, with the release of Mac OS X 10.3, Apple introduced a new AppleScript feature, user interface scripting, or UI Scripting, which can be used to do just that. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > What’s New with AppleScript in Tiger

May, 2005 - What's New with AppleScript in Tiger.

Lately, there has been a lot of buzz about Tiger, the latest version of Mac OS X. This new operating system version is full of new features and other goodies. With new applications and utilities like Dashboard, Spotlight, and Automator, Tiger is breathing still more new life into the steadily maturing Mac OS X.

While many of the new features in Tiger are geared toward the user level, there is also plenty that is new under the hood for developers. For AppleScripters, Tiger brings with it a number of bug fixes and new features with the latest release of AppleScript, version 1.10. In this month's article, we will walk through a number of these changes and enhancements. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Introduction to AppleScript Studio

April, 2005 - Introduction to AppleScript Studio.

In past articles, we have discussed many AppleScript-related topics. However, one of the topics that we have yet to touch on is AppleScript Studio, which is quickly becoming the tool of choice for AppleScript developers. [Read more at MacTech.com...]