I've encountered a problem running this applescript aimed at Devonthink from KM:
tell application id "DNtp"
try
set theSelection to the selection
if theSelection is {} then error "Please select a record"
set filepath to the path of the first item of theSelection
set the clipboard to filepath
end try
end tell
The weird thing is that it runs perfectly in Script Editor and Alfred but not in KM. With 'Save to System Clipboard' selected, KM just sets the clipboard to blank.
Other applescripts aimed at Devonthink do work in KM. For example, this works fine:
tell application id "DNtp"
open tab for record (content record)
end tell
When I run the first script in Script Editor (or Script Debugger), it shows a blank result, but the DT file path is in fact on the clipboard. So I think "Save to System Clipboard" is copying the blank result of the script over the file path that was just there.
If you run the script with "Ignore Results" and then add a KM action to "Display the Clipboard", you will see that the script has indeed worked and put the path on the clipboard