Ok… @PaulWalters is a genius.
I thought I’d take one more stab at it. Rather than being afraid of the “code”, I thought I’d try to model off his patterns and see if I could make it work. Guess what…it did.
Here is what I did.
First, I needed to replicate the user attributes that Paul created in his example: $MyPage, $MyURL, $MyTextStub. I tested this and found that he was spot on - the Page and URL were captured as attributes.
Then, I went to Expressions to figure out a RegEx that would work.
I then went and created a test stamp just focussing on the text part (per @mwra and Paul’s tutelage I finally have learned to work in smaller chunks when trying to figure stuff out, oh and in a test file).
Once I saw that this worked, I put the pieces together into a new GRp3 stamp, and it worked.
SUMMARY OF STEPS SO FAR:
-
Create a TBX file
-
Create a stamp with this code
$MyPage=runCommand("grep -o 'Page\s[0-9]*'",$Text);
$MyTextStub=$Text.replace("\[.*\)");
$MyURL=runCommand("grep -o 'x-devonthink-item://.*'",$Text).replace($MyTextStub).replace("\)");$Text=runCommand("grep -o '\*.*'",$Text);
NOTE: Change the $MyPage and$ MyURL attributes to whatever user attribute you’d prefer to use. I used these in the test file, but my preferred attributes are $DTPage and $DTUrl
-
Read and annotate a document in DEVONthink
-
In DEVONthink select your PDF and then Tools>Summarize Highlights>As Markdown; this will create a new note in DEVONthink
-
Drag the markdown note from DEVONthink on to Tinderbox
-
Explode the imported note, be sure to select delimiter and enter ##
-
Select one of the exploded imported notes and apply the stamp. See, it works.
-
Finally, change the note title to something that makes sense to you (Not done in this example).
-
Click on the globe icon (not currently visible due to Big Sur issues, but it is there, just click to the left of the URL) and watch DEVONthink open and take you to the note.
Now that we have the basics working, @mdavidson let’s work on automating the file name, differentiating between highlighted quotes in the original document and user generate text, notes, and detailed comments within the Tinderbox markdown. Again, I think we may be able to use different delimiters, like TBXN (for name of TBX note), TBXI (my idea), etc., not sure yet. Now need to go walk the dog before our 9:00 call today.
For those that are interested, here is my test file. DevonThinkAnnotation.tbx (98.9 KB)