Error running DEVONthink command via osascript

I need to get information from my DEVONthink database from within my shell scripts and I’m running into an error.

Weirdly, this works:

do shell script "osascript -e 'tell application id \"DNtp\" to return path of (get record with uuid \"745B87E0-3845-4592-ABF8-6D66D2E27404\")'"

But the same script, run in Terminal, produces a syntax error:

osascript -e 'tell application id \"DNtp\" to return path of (get record with uuid \"745B87E0-3845-4592-ABF8-6D66D2E27404\")'
> 20:21: syntax error: Expected expression, etc. but found unknown token. (-2741)

What am I missing?..

The Terminal script still uses quotes escaped for AppleScript. This should work:

osascript -e 'tell application id "DNtp" to return path of (get record with uuid "745B87E0-3845-4592-ABF8-6D66D2E27404")'

Indeed it does.

Ah yes of course, silly me… :slight_smile:

Never mind, the last post (deleted) was even more tired-brained than the first one. It’s working now.

3 Likes