Forked from msabramo/Alfred.app Append to nvALT Daily notes.applescript
Created
May 23, 2019 20:42
-
-
Save n3bulous/9dbe780fb0bceeb6a9134bc3c5777d8e to your computer and use it in GitHub Desktop.
Alfred.app Append to nvALT Daily notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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