Created
February 29, 2024 23:05
-
-
Save JezDriver/8ac308c60769056868537519e5d98956 to your computer and use it in GitHub Desktop.
Applescript to type the current date in ISO format (YYYY-MM-DD)
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 run {input, parameters} | |
| set {year:y, month:m, day:d} to (current date) | |
| # pad the day and month if single digit | |
| set day_str to text -1 thru -2 of ("00" & d) | |
| set mon_str to text -1 thru -2 of ("00" & (m * 1)) | |
| # make ISO8601 date string without time | |
| set thedate to (y & "-" & mon_str & "-" & day_str) as string | |
| tell application "System Events" | |
| keystroke thedate | |
| end tell | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment