diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
| commit | c80a54e42b52ce297f0f2f71af23c562832025c7 (patch) | |
| tree | dcce8bb977a770f473325d48f6f70b21d9818a40 /mac/.config/sketchybar/plugins/nextevent.applescript | |
init
Diffstat (limited to 'mac/.config/sketchybar/plugins/nextevent.applescript')
| -rw-r--r-- | mac/.config/sketchybar/plugins/nextevent.applescript | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mac/.config/sketchybar/plugins/nextevent.applescript b/mac/.config/sketchybar/plugins/nextevent.applescript new file mode 100644 index 0000000..6ffc56a --- /dev/null +++ b/mac/.config/sketchybar/plugins/nextevent.applescript @@ -0,0 +1,19 @@ +set input to paragraphs of (do shell script "/opt/homebrew/bin/icalBuddy -ec 'Found in Natural Language,CCSF' -npn -nc -iep 'datetime,title' -po 'datetime,title' -eed -ea -n -li 4 -ps '|: |' -b '' eventsToday") + +set currentTime to date (do shell script "date '+%I:%M %p'") + +set theEvent to "" + +if input is not "" then + repeat with anEvent in input + set text item delimiters to "^" + set eventTime to date (text item 1 of anEvent) + set text item delimiters to "" + if eventTime > currentTime then + set theEvent to anEvent as string + exit repeat + end if + end repeat +end if + +return theEvent
\ No newline at end of file |
