… But the annotation MD file does not contains any annotation, only the header…
Hmm. Did it work previously? I was using it a few days ago but can’t recall what version of DEVONthink I was on.
Yes, it was working flawlessly. What I’ve done is re-download both script and smart rule and install as new, deleting previous one, without luck.
And finally I understood the “debug” way and yes, it generates a new MD file… with the header only and no annotations. I’m using last DT version, 3.8.6, and it worked with same version before.
2 posts were split to a new topic: R Murphy - Stream Annotations
This is amazing and is working for me. It is storing the annotations in my inbox. I have setup a rule to move them to a group as instructed above.
But, the criticmarkup’s highlights are not getting removed for me.
Thank you. This is probably one important feature that is missing in Devonthink. I was really needing it and it works!
It is still not working in 3.8.7 version: it creates or updates the MD file, shows the a number of annotations, but MD file is empty. See captures.
Is this working for all of you?
Sorry for the delayed reply. Indeed, it’s still chugging along for me! You might want to try the following debugging process:
- Open the script, switch the debug flag to
true
, and save it. (For efficiency, you may also want to switch the value of delayAfterReadingSessionInMinutes to a lower number so that the script triggers faster. - Copy and paste the modified script into the smart rule. (Remember that inline scripts work better than script files for this.)
- Quit and relaunch DEVONthink.
- Annotate a file and wait for the trigger to fire.
The debug flag will report what’s happening as the script progresses to give you a sense of where it might be getting stuck. To shut debugging off, switch the properties back in the inline editor and then quit and relaunch DEVONthink.
I have the same md files. It works before I update to current version few weeks ago.
Yes, you are right. I enabled debug mode, started working, got incredibly surprised, then disabled debug mode, continued working (more surprisespren)… and then I remembered that I did that after update to 3.9.
Considering the Smart Group in DEVONthink has a time-based trigger. For example, executing your AppleScript hourly. So can the property delayAfterReadingSessionInMinutes
be removed?
This is up to you, although I recommend switching the value to 0 instead of deleting the variable.
Not sure if you still use this automation, I recently asked Claude how to modify the AppleScript, it worked again on my PDFs after modify the highlights iteration part. Thanks LLM!
-- Iterate through the highlights, and extract any newly-added annotations to the newAnnotations array.
repeat with eachAnnotation in highlightsArray
--repeat with i from 2 to count of highlightsArray
--if annotationIterator > previousAnnotationCount then
--set newAnnotations to newAnnotations & return & "* " & item i of highlightsArray
--if (eachAnnotation does not start with "(*# ") then
set newAnnotations to newAnnotations & return & "* " & eachAnnotation -- Prepend each line with "* " in order to keep each line consistent for cleanup in a moment.
--end if
set annotationIterator to annotationIterator + 1
end repeat
And what do you need the annotationIterator
for? It’s never even initialized.
Better not ask the LLM – it contains not a single causal vector
( though that won’t discourage it from stitching together more approximate retrievals, into syntactically plausible sequences, and cranking out more bland pabulum )