Skip to content

Instantly share code, notes, and snippets.

@swbuehler
Created June 27, 2010 05:24
Show Gist options
  • Save swbuehler/454665 to your computer and use it in GitHub Desktop.
Save swbuehler/454665 to your computer and use it in GitHub Desktop.
tell application "Evernote"
set receipts to every note of notebook "Receipts"
repeat with receipt in receipts
set theNoteTitle to the title of receipt
set theYear to the first word of theNoteTitle
set theMonth to the second word of theNoteTitle
set theDay to the third word of theNoteTitle
set theTime to the fourth word of theNoteTitle
set theHour to characters 1 thru 2 of theTime as string
if theHour < 12 then
set theAMPM to "AM"
else
set theAMPM to "PM"
if theHour > 12 then
set theHour to (theHour - 12)
end if
end if
set theMinute to characters 3 thru 4 of theTime as string
set theSecond to characters 5 thru 6 of theTime as string
set the creation date of receipt to (date ((theMonth & "/" & theDay & "/" & theYear & " " & theHour & ":" & theMinute & ":" & theSecond & " " & theAMPM) as string))
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment