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

MacTech AppleScript Essentials Column > Performing Basic Image Manipulation… Using Your Existing Software

March, 2005 - Performing Basic Image Manipulation... Using Your Existing Software.

This month, we're going to talk about performing some basic image manipulations with AppleScript. With the onset of the digital camera revolution comes a new set of problems for the computer user. The first thing many people realize after purchasing a digital camera is that film is essentially free, as is developing. You can take as many pictures as you like, just as long as you have ample hard drive space to store them.

While this concept seems amazing at first, you quickly realize that you now have thousands and thousands of image files to deal with. Those image files need to be downloaded, imported, renamed, filed, rotated, cropped, converted to other formats, and more! Sure, there are some tools that Apple gives us to help with these tasks, such as Image Capture and iPhoto. There are also a slew of other applications that you can download or purchase to aid with processing. However, wouldn't it be great if you could slap a few lines of code together to write your own application in order to help with your unique process? Well, using AppleScript, you can.

AppleScript is the perfect tool for automating many image-related tasks. As we have discussed in previous articles, AppleScript can be used to batch-rename files and folders. So, you could create a script that downloads your digital images into a custom folder structure and renames the images with the current date. You could create a script that opens up a folder of images in something like Photoshop and adds copyright information into the images' metadata. The possibilities are virtually limitless.

For this particular article, we're going to focus on performing some basic image manipulations, such as cropping, rotating, and resizing. We'll also look at ways you can convert your images to other formats, such as from JPEG to TIFF, and vice versa. Since AppleScript alone cannot manipulate images, you may be asking how will we do this? Using a background application named Image Events, which comes installed with Mac OS X, version 10.3 and higher, we can perform these tasks. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > An Introduction to Handlers

February, 2005 - An Introduction to Handlers.

In a previous article, you may remember that we discussed methods of writing AppleScripts to watch folders for incoming items to process. In each of the methods we discussed, we made use of handlers. This month, we are going to explore handlers in more depth. Since handlers are a fairly complex subject, the full scope of handlers will not be covered in this month's article. Rather, we will cover the basics of handlers. In future articles, we will discuss handlers in more detail. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Thinking Logically (Using If/Then Statements)

January, 2005 - Thinking Logically (Using If/Then Statements).

Last month, we explored adding different types of repeat loops to scripts, which is a very important and useful aspect of AppleScript development. As we discussed, by allowing you to perform a series of repetitive tasks without the need to duplicate code, repeat loops help to make your code less verbose, more efficient, and easier to change in the future. This month, we will focus on adding logic to your scripts, which is another important part of AppleScript development. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > Should I Repeat Myself? (Using Repeat Loops)

December 2004 - Should I Repeat Myself? (Using Repeat Loops).

For the past couple of months, we have been talking about some basic Finder scripting. Now we are going to switch gears and get back to some basics of AppleScript. In this month's article, we will discuss the various types of repeat loops that you can use when you are scripting. [Read more at MacTech.com...]

MacTech AppleScript Essentials Column > More Finder Scripting

November 2004 - More Finder Scripting.

We've taken a look at some basic Finder scripting, including creating, naming, and updating folders. This month, let's expand a bit further, and begin looking at some other scriptable Finder functionality. [Read more at MacTech.com...]