Odd error getting the selection

Have used Devonthink Pro with applescript for years. Had a script that all of a sudden stopped working and I have no idea why.

First lines of the script are

[b]Tell application “Devonthink Pro”
set thesel to the selection

end tell[/b]

When I run this, even though I have clearly selected certain items in my database, I get an error:

error “DEVONthink Pro got an error: Can’t get selection.” number -1728 from selection

This makes no sense to me. Any ideas what I’m doing wrong?

I’m not getting any errors here. What line is it actually erroring on?

Side note: the best option is to use the form

tell application id “DNtp"

I have no idea what went wrong, but rebooting my computer fixed the problem. Feel free to delete this thread.