I’ve been plodding around trying to figure this out on my own, so thought I’d ask here, given my limited AppleScript know-how –
Is there an AppleScript way to select a specific markdown text file in DEVONthink (the markdown file’s item link/ID never changes), clear the contents, and add new content (the current date at the top, in the form 2024-02-10, followed by a blank line)?
(/TLDR background – I have a “daily notes” system with a daily note always named “TODAY-W”, and the item link/ID never changes, for easier automation. I use a Smart Rule, triggered by a reminder at the end of the day, to duplicate this daily note and move the duplicate to an archive folder, where another smart rule renames it with the proper date. The final piece of the puzzle for me would be clearing the contents of the TODAY-W note, and putting the date (e.g., 2024-02-10) at the top, followed by a blank line, so I have a clean slate waiting for me to start each day. (I was doing all this with indexed files previously, using other methods, but sync got too messy.)
Thank you for any help.
P.S. I’ve fairly recently found that DEVONthink makes a great writing environment, after years of mostly using it as a repository for my files/data.