Scripting import to a static destination in DT

A certain class of item I am repeatedly importing into DT always goes to the same location (Group). I don’t need to invoke the group selector. What is the proper syntax in applescript?

Do I provide the posix path in the with parameter of the create record command, and omit the optional "in " part?

create record with {path:<posix path to desired group>, other properties}



The “in” parameter of the “create record with” command has to be a record but you can get the desired group via the “get record at” command.

You should not try and modify the internals of a database, via scripting or other method. It will lead to inconsistencies in the database, ie. Not A Good Thing.

You need to specify a location, not a path.
Also, if you read the Dictionary, you’ll see path of a record is a read-only property.

You need to get record at or get record with uuid (using the string from the item link). Here’s a simple example…

tell application id "DNtp"
	tell current database
		set dest to get record at "/Inbox/Test"
		create record with {name:"test", content:"test", type:txt} in dest
	end tell
end tell

Providing a location in this manner will suppress the group selector (heads up display thingy)?

(engaged in some unsuccessful testing…)


If the location doesn’t exist or can’t be resolved, it will fallback to whatever you’ve set in DEVONthink’s Preferences > Import > Destination.

OK, what I finally learned from all this tinkering is that setting a variable to preferred import destination is what invokes the group selector…

Back on track.