Skip to content

Instantly share code, notes, and snippets.

@mapledyne
Created July 28, 2015 17:15
Show Gist options
  • Save mapledyne/8d7a9e085fe6bd1c3d4f to your computer and use it in GitHub Desktop.
Save mapledyne/8d7a9e085fe6bd1c3d4f to your computer and use it in GitHub Desktop.
Various tasks to clean up my triage notebook in Evernote
tell application id "com.evernote.Evernote"
-- Move/tag Fitbit status updates
set note_query to "notebook:triage source:mail.* fitbit"
set myNotes to find notes note_query
repeat with CurrentNote in myNotes
assign tag "fitbit" to CurrentNote
move CurrentNote to notebook "Michael"
end repeat
-- Move/tag Wave monthly invoices
set note_query to "notebook:triage source:mail.* wave broadband"
set myNotes to find notes note_query
repeat with CurrentNote in myNotes
assign tag "internet" to CurrentNote
assign tag "invoice" to CurrentNote
move CurrentNote to notebook "Yesler's Mews"
end repeat
-- Move/tag Flagstar mortgage statements
set note_query to "notebook:triage StatementViewer"
set myNotes to find notes note_query
repeat with CurrentNote in myNotes
set title of CurrentNote to "Bridge condo mortgage statement " & month of (current date) & " " & year of (current date)
assign tag "mortgage" to CurrentNote
move CurrentNote to notebook "Bridge"
end repeat
-- Move/tag Fulcrum pay stubs
set note_query to "notebook:triage source:mail.* Earnings"
set myNotes to find notes note_query
repeat with CurrentNote in myNotes
set {year:y, month:m, day:d} to creation date of CurrentNote
-- Note: Month will return the text month from the above command.
-- Doing some simple math on it (multiplying it by 1) will force the string back
-- a number.
set title of CurrentNote to "Fulcrum Pay Stub " & y & "/" & m * 1 & "/" & d
assign tag "money" to CurrentNote
assign tag "pay stub" to CurrentNote
move CurrentNote to notebook "Fulcrum"
end repeat
synchronize
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment