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.
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).
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:
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
Aete2sdef is a free software. Its source code is also publicly available.
Please e-mail any problem or bug you encounter: bdesgraupes@users.sourceforge.net
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