I'm trying to create Macros for the DevonThink Ratings menu and also the Labels menu. Ratings is a submenu found under data. What kills me is I can't find a way to invoke the stars themselves.
I even tried recording a macro just to show me what KM sees. KM sees Data -> Rating -> blank
If the app doesn't have keyboard shortcuts for those ratings, then the next consideration is whether the app support AppleScript. You can open the app using the Script Editor app and see if there's support for changing the rating using AppleScript. If that doesn't work then we may need to use KM's mouse click actions. How important is this that you don't use the mouse for the solution? If you're just trying to get this macro to run when you aren't on your Mac, then I guess speed and mouse issues aren't too important.
Hi @mlevison, the AppleScript is from the DEVONthink forum:
-- Import helper library
tell application "Finder" to set pathToAdditions to ((path to application id "DNtp" as string) & "Contents:Resources:Template Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions
-- Get the selection
tell application id "DNtp" to set thisSelection to the selection
-- Error handling
if thisSelection is {} then error localized string "Please select a document or group, then try again."
if (length of thisSelection) > 1 then error localized string "Please select only one document or group, then try again."
tell application id "DNtp"
set thisItem to first item of thisSelection
set rating of thisItem to 3
end tell
I have created a macro group for you. After entering the shortcut, you can click on your ratings with the mouse.
If you prefer to work only with the keybaord, then you must enter the shortcut once in this macro and then confirm your selection with 0 to 5. Of course you can also replace the numbers with letters.
Thanks, AppleScript and I have a poor working relationship. Magically it won't do what I expect and then spend days staring at it trying to figure out the why :-). The irony is that I'm recovering software developer.
In this case I can prove script got invoked - I added a text display and it appears so the function is being invoked. From there I don't where to look to see what what failed.
@appleianer Thanks for the help. MacOS in German - I just assume its a side effect from long term use of DevonThink. It's developed in German. I wonder if that will happen to me in a few years.
As soon as I checked that it worked. Now of course the only problem is where to record this so I don't forget the next time I need to automate something simple.