Posted on April 21, 2008 at 7:36 am

Application Scripting

AppleScript shines at bossing around your applications. Not only can you use AppleScript boss around individual applications, you can also use it as a conduit to transfer data from one application to another. A common example involves transferring data from a database application such as FileMaker Pro to a word processor such as Microsoft Word. You might also transfer data from a database to a spreadsheet application and then to your word processor. Or read data from a text file into a spreadsheet to produce a report or into Timeline to produce a timeline. As you can imagine, the possibilities are endless. (Update: Pete Summerill, the Mac Litigator, has produced a script that combines Adobe Acrobat Pro and Journaler. If you use these apps, take a look.)

In the next few posts, we’re going to build a database in FileMaker Pro and learn how to script it using FileMaker Pro’s AppleScript dictionary. We’ll create a simple database with some fields and use AppleScript to access those fields. Once we have the data in AppleScript, we can send it to another application. We’ll send our data to Microsoft Word 2004 to create a letter.

Administrative: I’d like to ramp up the frequency of the posts, but I don’t want to move too quickly so as to leave new scripters behind. I’d like to hear your feedback regarding the frequency of the posts. Would you like to see more posts more often or do you like the current one post per week rate? Please leave your thoughts in the comments.

Rubyists: Normally, you cannot control FileMaker Pro with Ruby. Because rb-appscript translates our Apple Events to Ruby, we can use the same commands to control FileMaker. Another database that supports AppleScript is OpenBase, a very fast and compliant database. Please note, though, that a Ruby library exists to access OpenBase, so you probably want to use it instead of AppleScript.

3 Responses to “Application Scripting”

  1. Brock Benjamin on April 21st, 2008 at 9:02 says:

    I’m all for more posts. I only have to follow, you have to create… How different would scripts be to access OpenBase as opposed to FileMaker?

  2. statonjr on April 21st, 2008 at 9:16 says:

    @Brock:

    The scripts for OpenBase are different enough from FileMaker to warrant their own post. The difference is due to the underlying data structure of the applications. OpenBase relies on the SQL standard. FileMaker has its own data structure. As such, the apps use different terminologies.

  3. Brock Dagenais on May 18th, 2008 at 14:34 says:

    I’m an attorney who uses Mac and Filemaker therefore I am looking forward to seeing your Filemaker scripts.

Leave a Reply