Just some side notes…
- We advocate using
tell application id "DNtp"
. - Also, this code block is unnecessary though not necessarily incorrect)…
-- Launch DEVONthink if it isn't already open.
tell application "System Events"
if not (exists process "DEVONthink Pro Office") then
tell application id "com.devon-technologies.thinkpro2" to activate
end if
end tell
Sending a command to DEVONthink will launch it.
- Lastly, note the
activate
command will bring DEVONthink to the front.
You can uselaunch
to run a command without bringing the app to the front, though that’s actually not necessary here.
launch
is typically used to open an app without switching from your current one, but would be unneeded here. However, some apps may require it, as needed.