Day 1 beginner lesson
Download the script to your desktop Journal.scpt
DoubleClick to launch ScriptEditor app
Click the run icon
Future advanced lesson
Proper filing for the script and easier execution
The objective was to launch Evernote search with day1 and day2
The code is simple
-- Get Day1 and Day2
set {year:yyyy, month:mmm, day:d, weekday:dddd} to (current date)
set yyyy to yyyy - 1
set dd to (text -2 thru -1 of ("0" & d as text))
set m to mmm as integer
set mm to (text -2 thru -1 of ("0" & m as text))
set Day1 to yyyy & mm & dd as string
set {year:yyyy, month:mmm, day:d, weekday:dddd} to ((current date) + 1 * days)
set yyyy to yyyy - 1
set dd to (text -2 thru -1 of ("0" & d as text))
set m to mmm as integer
set mm to (text -2 thru -1 of ("0" & m as text))
set Day2 to yyyy & mm & dd as string
-- Launch Evernote
tell application "Evernote"
activate
set query string of window 1 to ("created:" & Day1 & " -created:" & Day2)
end tell