Jump to content

Applescript without appleworks?


This topic is 6504 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have done alot of scripting in fm, macros ect in excell but never used applescript. I want to learn where and how so I can enhance my fm scripts by using embedded applescripts. In all the tutorials I have looked at you have to use it with appleworks, which I haven't used for a couple years. Where can I go to learn applescripting without having appleworks or is it one in the same?

Version: v6.x

Platform: Mac OS X Panther

Link to comment
Share on other sites

No, AppleWorks is a "works" application, word-processor, spreadsheet, etc.. AppleScript is a "high-level" scripting language, which sits on top of the operating system (more or less). It is always available, to any application which is AppleScriptable, as most Mac applications (worth beans) are.

First, the application to write AppleScripts is named Script Editor. The version with Panther is quite fancy. To see what AS can do with an application, you open its "dictionary." Choose Open Dictionary... in Script Editor's File menu. It will show every darn AS-saavy app on your hard drive (lots, kind of slow, but thorough).

You can also drop an app icon onto SE to open its dict.. FileMaker ships with many examples, as well as a FM file that details much about AS.

The step you use in FM is "Perform AppleScript." It works pretty much the same as running the same script from SE; but, 1. You don't need to 'tell application "FileMaker Pro"' inside FM (unless the call is nested), and 2. It's much faster run from inside FM.

I use SE to write the scripts, then, when it's working, copy paste into FM, removing the surrounding tell block. SE has much better error checking. It tells you what's wrong, and where. In FM it just tells you cryptically what's wrong, not where.

SE can also show you the result, even log every step and its result. There are other more advanced apps, such a Smile. But SE is pretty decent. They all have colored syntax, which is very helpful.

BTW, the "Finder" is an AppleScriptable app. You can also run UNIX shell scripts from AS (and conversely AS from UNIX shell).

Simple example, open a file (any type), with its creator application, from a filepath in a field in FM; in a Perform AS step:

tell current record of document 1

Link to comment
Share on other sites

applescript is not related to appleworks. It is a scripting language built into the OS and implemented in many mac programs. If you open the script editor (in the applescript folder, which is in the applications folder) you can open applescript dictionaries (in the file menu) and this will give a list of commands supported by different apps.

In the filemaker pro folder you will find a "Filemaker and Apple Events" folder that contains a .fp5 database with some examples of how you can script filemaker using applescript.

Link to comment
Share on other sites

This topic is 6504 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.