Adding a dictionary to a library

I have a couple libraries I’ve written that I want to try to add an appleScript dictionary to.

I believe I’ve figured out the mechanics:

  • Building the XML file (in BBEdit)
  • Adding Suites, classes, commands and enumerators
  • Writing AE Event codes

Is there anything else to be aware of?

Also, way back in the day Cal Simone had some kind of a style guide for writing appleScript commands and dictionaries. Is there anything like that now?

Cal’s style guide, and good practice for app dictionaries, emphasises building a good object hierarchy, and using properties instead of making new commands where possible. But in a script library, that’s generally not practical – by their nature they tend to be almost totally command-based.

The main think I’d advise is to concentrate on not clashing in either terminology or event codes. Using multiple-word terms decreases the chance of clashes significantly.

I’m trying to do something that should be simple (although take a long time), but it’s not working.

I want to search the contents of every application package in the Apps folder, and every script bundle in the Script Library folders for .sdef files.

My script will then read them, extract the names and codes for all the Suites, commands, objects, ennumerators and save them to a tab-separated text file I can look at in Excel, numbers or Myriad tables.

I’ve tried both the MetaDatalib and the FileManagerLib but in the first case I get nothing, in the second case I crash SD.

Any suggestions?

What happens if you try FileManagerLib in an applet?

Is this the guide?

Thanks for that. I hadn’t seen it (or Cal’s picture) for years.

In case anyone else is interested…

Introduction to Cocoa Scripting Guide

Preparing a Scripting Definition File