Thanks korm and mbbntu for your input.
I did originally run this from within Hazel and was having issues which then lead me to run it directly from script editor to try and troubleshoot. But as you’ve suggested I’ve reverted back to running within Hazel and I am getting the following errors appear:
The following is the exact script I have embedded into my hazel rule:
tell application "Finder"
set _path to (the POSIX path of theFile as string)
set {_name, _extension} to {name, name extension} of theFile
end tell
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
tell application id "com.devon-technologies.thinkpro2"
set theGroup to get record with uuid "D95C7EBA-FB02-43AA-9115-163425413560"
set theImport to import _path name _name to theGroup
end tell
I am still using DevonThink Office Pro 2.
And for completeness, below is the Hazel rule I have in place: