Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save msabramo/3745625 to your computer and use it in GitHub Desktop.
Save msabramo/3745625 to your computer and use it in GitHub Desktop.
Alfred.app Append to nvALT Daily notes
on alfred_script(q)
set theYear to year of (current date) as string
set theMonth to (month of (current date) as number)
if theMonth < 10 then
set theMonth to "0" & theMonth
else
set theMonth to "" & theMonth
end if
set thisDate to (day of (current date) as number)
if thisDate < 10 then
set thisDate to "0" & thisDate
else
set thisDate to "" & thisDate
end if
set theDate to "" & year of (current date) & "-" & theMonth & "-" & thisDate
set theHours to (hours of (current date) as number)
if theHours < 10 then
set theHours to "0" & theHours
else
set theHours to "" & theHours
end if
set theMinutes to (minutes of (current date) as number)
if theMinutes < 10 then
set theMinutes to "0" & theMinutes
else
set theMinutes to "" & theMinutes
end if
set theTime to theHours & ":" & theMinutes
tell application "nvALT"
activate
tell application "System Events"
keystroke "l" using {command down}
keystroke "Daily notes" & return & return
keystroke (ASCII character 30) using {command down} -- command + up arrow to go to top of note
keystroke theDate & " " & theTime & " -- " & q
-- keystroke "v" using {command down} -- Command+v
keystroke return
-- Change this part to your global hotkey
keystroke "n" using {command down, control down, option down}
end tell
end tell
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment