On my Mac where the API uploads go only to the database inbox of several long-term production databases…
I created a brand new database with several groups and subgroups.
I changed nothing else about the configuration of DT3 or my computer.
It works perfectly in the new database by uploading to the desired group or subgroup.
If I try it with the original databases it still goes only to the database inbox with the API/Python (but to the proper Group with the direct JXA script)
All databases verify without error
Very interesting … what might be different about the databases where it does not work?
Though that might be an idea, I think it does not apply here. The UUIDs are ASCII only, and the script fails (at least with one database/group) with osascript, too. No python involved, there.
I inserted the parameters including the UUID to a group in my longstanding main database. When I run the script, the file is added to the Inbox of the longstanding database. (So it fails there.)
Then I changed nothing except I changed the UUID to a group in my newly created test database. When I run the script like that, the file is added correctly to the desired Group.
Could you please _print _ the uuid with console.log and check that it is correct in both cases? Also, a screenshot of the Apple events would be helpful (again, in both cases)
but that will probably also return the correct UUID and hopefully “group” for the type. @cgrunenberg would then have to weigh in on the question when the import(...{to: ...}) could go to the inbox instead of the group itself.
Also for comparison… using Script Editor and the same UUID this script ** does ** result in the file being inserted into the correct group in both the older and newer databases:
function run() {
app = Application.currentApplication(); app.includeStandardAdditions = true;
dt = Application("DEVONthink 3"); dt.includeStandardAdditions = true;
var dtUUID = app.displayDialog("Insert UUID (not x-devonthink-item link):", {
defaultAnswer: "",
buttons: ["Cancel","Continue"],
defaultButton: "Continue"
})
var document = app.chooseFile({
withPrompt: "Please select a document to import:"
})
var destRecord = dt.getRecordWithUuid(dtUUID.textReturned)
dt.import(document.toString(), {to:destRecord})
}
I can’t reproduce the issue, the script works fine here using item links (since version 3.7.2 supported by get record with UUID) for groups in various databases
OK - the example UUID I posted where it goes to the database inbox is on a database which is for me but has no client data so I can send you privately a copy of that. Thanks.
Your groups are not excluded from tagging (see File > Database Properties), therefore by importing the file to a group the record gets a tag (the group’s name) and setting no or different tags afterwards removes the record from the group again.
In case of a new database groups are by default excluded from tagging.