create record with DT Pro 2

Hello,
The AppleScript snippet below doesn’t work with my new Devonthink Pro Office 2 beta. The debugger displays a “Missing value” error. I don’t understand what I have forgotten. Thanks for your help,
Christophe

tell application "DEVONthink Pro"
	
	open database "/Users/.../DEVONthink.dtBase2"
	set theInbox to create location "/test"
	set theRecord to create record with {name:"try", type:plain text} in theInbox
	
end tell

Just replace “plain text” with “text”.

Thanks for your replay. I have just replaced plain text with “text” (with or without double quotes), but it still displays the missing value error message.
Christophe

Does this code work and create the group & the file in the current database?


tell application "DEVONthink Pro"
	set theInbox to create location "/test"
	set theRecord to create record with {name:"try", type:text} in theInbox
end tell

Thanks for your support.
It does create a directory in the current database, but the file is not created.
Christophe

This might be a GUI glitch. Please close and reopen the window - is there still no file?

There’s no file even though I close the window or relaunch the application. The History palette doesn’t show any file either.
Please find a screen shot as an attachment

This happens if one does not specify any contents for the text file.

The solution is quite simple:

tell application "DEVONthink Pro"
	set theInbox to create location "/test"
	set theRecord to create record with {name:"try", content:"", type:text} in theInbox
end tell

Houthakker

That’s it. Thank you very much for your help.
Christophe

Ah, sorry. I’m using the latest build of course which supports this without specifying a content :blush: