Batch Convert Files

2005.03.08 

 

http://www.barefeetware.com/appleworks/batch_convert/

Description

 

This AppleWorks command converts the files selected in the Finder to the format of your choice, asking you for the output location.

Enhancement
Pack

 

This is one of 40 features added by the Enhancement Pack for AppleWorks.

     


Detail
The “Batch Convert Files” command is in the “Document” sub-menu of AppleWorks Scripts Menu. To use it:
    1. Select some files in the Finder.
    2. Select the “Batch Convert Files” menu command.
    3. When asked, confirm the list of files to be converted by clicking OK.
    4. From the list of translators, select the desired option.
    5. Choose the appropriate destination for the translated files.

Advanced
This command can only translate to formats that are available to AppleWorks. If you can’t manually save as a particular format, then this script can’t do it either.

AppleWorks 6 builds the list of translators according to what you have installed (eg MacLinkPlus). For AppleWorks 5, you need to add an installed translator to this script’s list by following the directions below under “Scripting”.

There is a bug in AppleWorks 6.0 that prevents AppleScript from saving as any format that appears above the line in the File Format pop up menu in the Save As dialog box. Specifically, these formats are: AppleWorks (ie version 6), AppleWorks 5.0, ClarisWorks 4.0, ClarisWorks for Kids. This script has a work around for “AppleWorks”, but the others will fail with an error:

“Cannot save the document. If you can manually translate it, then there is an AppleScript bug in AppleWorks. Otherwise, the translator is not supported for this type of document.”

To save as AppleWorks 5.0, if you have MacLinkPlus installed, you can select the “AppleWorks [MacLink®]” in the script’s format list (see “Scripting” below), to work around this bug in AppleWorks 6.0.

Requirements
Operates on the selected files in the Finder. Works with AppleWorks 5 and 6.

Only registered users are permitted to use the supplied files after 14 days or edit them.

Download
This script is included in the Enhancement Pack for AppleWorks, not supplied separately.

Scripting
This script may be edited by registered users.

AppleWorks 6 builds the list of translators dynamically.

Unfortunately, AppleWorks 5 provides no mechanism for AppleScript to read the installed translators. To adjust the available translators, change one of these lines, depending on your version of AppleWorks:

property translatorsAW5 : {"AppleWorks", "ClarisWorks 4.0", "ASCII Text", "Text", "RTF", "PICT"}

Add a translator name exactly as it appears in the “File Format” pop up menu in your AppleWorks Save As dialog box.

The main statements are:

open file filePath
save front document in file ((outputFolder as text) & fileName) using translator translatorName

Please email us any queries about this page.