Editor for Dictionary Files (.sdef)

I would appreciate hearing from those of you who create Dictionaries the software you use to create the xml file. I am new to creating Dictionaries. I expect that an xml editor would be preferable to a simple text editor, such as TextEdit.

Thanks!

The one I’m using is a bit old but still working (at least on Hight Sierra…).
I’m using it right now!

Sdef Editor

:wink:

Jonas: thank you for replying. I came across Sdef Editor - in fact, it is the only program specifically for editing sdef file I encountered. Unfortunately, it does not run on macOS 11 as it is 32 bit.

Sdef Editor is open source, with the last contribution made a 3 years ago. Some enterprising person could try building it with a modern version of Xcode :wink:.

1 Like

I actually wrote one as part of ASObjC Explorer. In the end, though, I found it easier to use BBEdit. I just start with an existing file open and copy-and-paste bits as I need them, then edit them to suit. It’s useful to have the man page for sdef(5) open, too.

2 Likes

It’s easy for you because you know exactly what you’re doing.
But for [beginners] scripters who are not developers, the XML structure of a SDEF file is way over too complex.

I’m sure there’s a place for a paid application in the Applescript community.
We just need a good tuto to understand the benefits of using libraries and how much adding to them dictionary file is a must and very easy to do (if you have the good tool!).

1 Like

I’d probably argue that unless you plan to distribute them to others, there’s not a lot of point.

It’s one of those things that I don’t really remember. But if you start from an existing dictionary, cut-and-paste does make it relatively painless. You want a command, you look for a command, hopefully with a similar number of parameters, and you cut and edit.

I suspect it needs more than that, if @tempelmann’s issue shown in the depository still holds.

I wrote my first Dictionary yesterday (after my original post.) I used what is, basically, the method Shane described. The xml structure of a Dictionary doesn’t seem complex. I anticipate that cutting/pasting from a template or prior Dictionary will work pretty well. At this point, for me, it doesn’t seem like an xml editor will be necessary, as I thought when I first posed the question. Thanks to all the responders.

One entry I suggest for all dictionaries:

    <class name="reference" code="obj " hidden="yes">
        <synonym name="specifier"/>
    </class>

It helps avoid an issue that can occur where compiling scripts using libraries results in reference changing to specifier.

4 Likes

Did anyone try XML Notepad?

What’s the status of ASObjC Explorer? Is it available?

I have build it with Xcode 14. Looks quite ok. Only in dark mode there are a few small display errors:

Edit: See Last Build

5 Likes

Dirk, you are a gentleman and a scholar and a developer in the best sense of each word.

I will put this through it’s paces and let you know if I come across any bugs.

Thanks!

3 Likes

Well and truly dead.

Wow it works. Thanks for this!

When Sdef Editor stopped running on 64-bit systems I tried to build it several years ago - but with no luck.

It’s great to have this app back.

3 Likes

Thanks @Dirk for sharing.

This tiny app is a time-saver and a great learning tool for those of us who are not developers.

2 Likes

Little Hotfix:

If a command was defined with only a direct parameter or a result type, the entries were stored outside the command block.

Edit: See Last Build

3 Likes

Would sure like to use this to inspect .scptd file sdefs too.

Also, does anyone know where the sdef file for Standard Additions is?

/System/Library/ScriptingAdditions/StandardAdditions.osax/Contents/Resources/StandardAdditions.sdef

2 Likes