AppleScript record properties reference

Hi.

I’m trying to improve a script which imports pinboard.in-bookmarks to DEVONthink Pro:


[...]
set theUrl to (value of XML attribute named "href" of theElement) as string
set theName to (value of XML attribute named "description" of theElement) as string
set theTag to (value of XML attribute named "tag" of theElement) as string
[...]
then create record with {name:theName, type:bookmark, URL:theUrl, tags:theTags} in theGroup

This works, but i want to add some more information, namely:

time=“2013-03-05T12:08:02Z” -> creation date
extended=“DS18S20” -> spotlight comment

Which field does “record” support? Is there a documentation/reference to the AppleScript methods Dt offers?

Thanks.

A “record” is the basic data structure for a DEVONthink entity (document, group, etc.). “record” is not a field, it contains “fields” (properties).

Open ApplesScript editor and from File > Open Dictionary … browse to the DEVONthink dictionary for further information.

The best way to learn DEVONthink scripting is to evaluate existing scripts. The answers to all of your questions have been posted in the forum or are contained in the scripts the ship with DEVONthink.

Yeah, i was missing the “s”. I didn’t know which fields are accessible in a record, unless:

Gee, thanks. I wasn’t aware that this exists.

Okay, creation date and spotlight comments are up and running. But there are some properties for which i can’t find any information in the dictionary:

For the record type “bookmark”
→ unread:true/false → no effect
→ state:true/false → no effect

The first one i can understand (bookmarks not having a read/unread status), but the second one… shouldn’t this set the “flagged” status?

Is there a reference which field of “record” has which effect depending on the type of the record?

Thanks!

@ klapauzius , there seems to be something not working with setting state or unread in create record. As a workaround, I found that this works:

set theRecord to create record with {URL:theURL, type:bookmark} in theGroup
	set unread of theRecord to true
	set state of theRecord to true