How to get "id" working for scriptable objects?

When I issue

id of first document

in my scriptable app, it leads to the error "Can’t get id of document 1." number -1728 from id of document 1.

I did declare it in the .sdef, though:

<class name="Find Any File" code="FAFa" inherits="application" description="The application's top-level scripting object.">
	<cocoa class="NSApplication"/>
	<element type="document">
		<cocoa key="orderedDocuments"/>
		<accessor style="id"/>
		<accessor style="index"/>
	</element>

How do I make IDs work in my scriptable objects?

Answer to self: Need to implement the objectSpecifier method for the class. See How to declare window subclasses in sdef? - #10 by alldritt for some examples