Group location representations

I’m was trying to put together an Applescript that would import a document to a specific group that is hard coded into the script. I got it to work using the UUID of the group, but it would make life easier if I could refer to the group using the typical POSIX-like path representation.

The following example works just fine:```

tell application “DEVONthink Pro”
set theFile to choose file
set theGroup to get record with uuid “”
import theFile to theGroup
end tell

but this example does not:```

tell application "DEVONthink Pro"
	set theFile to choose file
	set theGroup to create location "/OCRtemp" of database id 2
	import theFile to theGroup
end tell

When the second example fails I get the following error message:

I have no idea what I’m doing wrong with this second example, any have any guidance?

set theGroup to create location “/OCRtemp” in database id 2

You should be error trapping for if the desired database is open.
Note, that it’s easier to refer to a database by something other than its id. This will fail if database id 2 is not open.

The ID of a database is not persistent, you should use the name or the UUID of the database instead.