What I want to do is be able to scan my bus ticket and snatch the expiration date and make a calendar entry to remind me to refill it. So getting the ticket to be scanned and OCR and wind up in iCloud drive is the easy part using Scanbot.
The second part I don’t know how to do gracefully, Hazel can quite easily pick up the document and identify the expiration date but with that data, the only thing I can do is rename the file. So how would you guys solve this? Get KB to pick up the file and execute some script magic or is there a better way?
Hazel can run shell scripts or AppleScripts, so after you have the date parsed, you should be able to create an event on your calendar using AppleScript.
Wow! just wow, it worked like a charm. Well not a charm since Hazel is a mess in Catalina but still it works! can not thank you enough.
So if anyone else would like to use it here is how i did it.
Fetch the date via pattern matching in Hazel Save it to a variable called “date 1”.
Add the variable as an attribute in Hazel.
Finally add the script.
tell application "Reminders"
set theDate to item 1 of inputAttributes
# Select the relevant list in Reminders.app
set myList to list "Your Calendar"
tell myList
# Create the reminder
set newReminder to make new reminder
set name of newReminder to "Your reminder text"
set remind me date of newReminder to theDate
end tell
end tell