Aete2sdef generates Scripting definition files (sdef) from AppleScript Terminology resources (aete or aeut). It can be useful for developers who want to transfer already existing resources to the new sdef format.

This file documents version 1.1 of Aete2sdef.


Introduction

Scripting definition files (sdefs) are XML files that describe everything about an application's scriptability: terminology, implementation information, and complete documentation.

The format of the sdef files is defined by a DTD (Document Type Definition) located in /System/Library/DTDs/sdef.dtd and described in a manual page (type "man sdef" in a Terminal window).

The tool sdp uses sdefs to generate a variety of implementation and definition files for use in an application and in AppleScript. In particular, from a sdef file one can obtain a Rez file (with .r extension) describing an 'aete' resource or a pair of terminology files for Cocoa scripting (.scriptSuite and .scriptTerminology files).

Aete2sdef does the opposite: starting from an 'aete' (AppleEvent Terminology Extension) or an 'aeut' (AppleEvent User Terminology) resource, it generates a sdef file.

What is this useful for? Well, sdef files are recent while the 'aete' resources have been used by developers for years. If someone wants to switch to the sdef scheme, rewriting everything from scratch can be painful: with Aete2sdef you can retrieve all your 'aete' data and get a good basis for starting working in the new environment. It can also help you to transfer your 'aete' resources to Cocoa scripting, if you are rewriting an application from Carbon to Cocoa for instance: you would apply Aete2sdef to the 'aete' resource to get a sdef file, and then apply the sdp tool to this sdef file to get .scriptSuite and .scriptTerminology files.

There is not a one-to-one mapping between the data contained in an 'aete' resource and in a sdef file. The conversion in both directions is necessarily lossy. Nevertheless Aete2sdef does its best to preserve what they have in common.

Aete2sdef is scriptable (see below).

How does it work

Aete2sdef operates on files which contain 'aete' or 'aeut' resources (typically application files). It extracts the resources and produces an sdef file for each of them. If your original file is MyApp.rsrc and it contains two 'aete' resources with ID 128 and 129 respectively, Aete2sdef will create two files named MyApp_aete128.sdef and MyApp_aete129.sdef respectively in the same folder as the input file.

The output files are UTF-8 encoded as stated in their top processing instruction:

<?xml version="1.0" encoding="UTF-8"?>

If you want the sdef files to be in another encoding, you will have to convert them using an appropriate text editor.

There are three different ways of making this conversion:

  1. when it is running, the Aete2sdef application has a single menu item called Convert Aete... which lets you select the file containing 'aete' or 'aeut' resources you want to convert.

  2. in the Finder, you can also just drag the file cntaining the 'aete' or 'aeut' resources and drop it on the icon of Aete2sdef. One can drag and drop several files simultaneously onto the icon of the application.

  3. you can execute these actions in an AppleScript script. For instance, you can execute the following instruction in the AppleScript Editor:
    	tell application "Aete2sdef"
    		set theFile to (choose file)
    		convert theFile
    	end tell
    

Note that Aete2sdef expects a file as input: it will not accept a bundle. If your resource file is inside a bundled application, you must specify the complete path to the resource file, like /Applications/MyApp.app/Contents/Resources/MyApp.rsrc

Download

To download the application click here.

Aete2sdef is a free software. Its source code is also publicly available.

Version History

Known problems

Please e-mail any problem or bug you encounter: bdesgraupes@users.sourceforge.net

License and Disclaimer

This is a free software. It is distributed under a BSD License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.


Last updated 2006-10-16 17:34:53