DTP always pops up group selector with Javascript/JXA

Hi there –

I’m somewhat just starting out using JXA/Javascript to script DevonThink, but I’m running into one weird speedbump:

Most things that I try to do cause the group selector (e.g. the import destination selector) to pop up, e.g.:

app=Application(“DevonThink Pro”)
pr = app.properties()

This is clearly tied to having “Select group” chosen as the Destination in the Import tab of Settings.

But clearly that’s not desirable – no import is happening, this is a read-only operation, and it’s a script, rather than interaction with the UI.

Any ideas why this is happening?

Regards,
Neil

Confirmed.
On a side note, have you considered just using Applescript?

That’s an issue of JavaScript accessing all properties as the “preferred import destination” property might use the group selector. One workaround is to change the preferences, another one to use AppleScript.

Thanks, guys.

Yeah, AppleScript doesn’t really float my boat, but I do it through gritted teeth when necessary. I’m not really a JavaScript convert, either, but it’s closer to home for me.

Neil

BTW - Christian’s comment was super helpful here – it’s simply that it’s grabbing the incomingGroup property, so that accessing other properties directly won’t trigger the same issue.