I’m moving away from using Eagle for video notes because there’s no linking nor an easy way to export the notes after you generate them and I stumbled on DEVONthink’s Insert Back Link in the Annotations and that it even does timestamps. This is nearly perfect!
What I really liked about Eagle is that I could hit the note hotkey and it would pause, pop up a note panel for me to write and then resume playback after I close the note UI. I’m trying to automate doing roughly the same thing in DEVONthink.
I don’t see a direct way to play and pause the video in DEVONthink’s dictionary but I’ve been able to get it to work with UI scripting, it’s brittle but I don’t change around my UI configurations much so other than needing to add an option for playback depending on whether it’s a document window or a viewer window that’s not the end of the world.
Since I can’t really dismiss the annotations panel I’ll just run it again to toggle playback. I generally avoid AppleScript unless I absolutely have to use it so forgive me if my inexperience with it is making this more complicated than it should be.
tell application "DEVONthink 3" think window 1 # Check if item content type is a video if (exists MIME type of content record) and (MIME type of content record contains "video") then # Check if playing, if so pause and add annotation, if not hit play. tell application "System Events" tell its UI element "DEVONthink 3" if (get value of checkbox 1 of group 2 of splitter group 2 of splitter group 1 of window 1) is 1 then # Pause click checkbox 1 of group 2 of splitter group 2 of splitter group 1 of window 1 else # Play click checkbox 1 of group 2 of splitter group 2 of splitter group 1 of window 1 end if end tell end tell else display notification "You aren't playing a media item." subtitle "Playback Invalid" end if end tell
Here’s where I get stuck and I have a couple of questions.
- First, is there a reason to use
MIME typeas recommended here?
- Since my annotations will ultimately end up in my Obsidian/Taio/DEVONthink indexed zettelkasten I’d like to use markdown and preferably format it slightly. Is there a way to programmatically create a Markdown annotation note without having to UI script
menu button 3 of splitter group 1 of window 1 of application process "DEVONthink 3"then select New from Template/*template name*?
- Once the annotation type is set I’d like to be able to insert a
-to make it a list, it seems like trying to activate the annotations panel, insert the string
*new line*-then hit ^⌘ L is probably not ideal. I could get the value of the panel, manipulate the string in the script and set it again may be better but not great. Is there a more elegant way to do all of this that I’m missing? Can I use the AppleScript Dictionary to find the annotation file and set it that way?
- If I was to manipulate the annotation directly instead of using ^⌘ L it looks like the recommended way to get the current timestamp would be to grab
current movie framefor the current window and generate it from that but that’s returning some kind of encoded string I don’t recognize or know what to do with, is
current timethe better property?
- This isn’t actually automation related but it doesn’t seem like there’s a way to change the playback speed unless I’m missing something, though someone mentioned doing it with the mouse here. I’m not just missing some way am I? This is something I can live without but it would be nice.
Thanks for the help, I absolutely love DEVONthink and this is so close to the perfect tool I’ve been looking for to do video annotations. I am also looking at external video players that let me get the current frame via AppleScript or copy a timestamp that I could just paste into DEVONthink too but so far I haven’t found one with