You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
# This is an action script for TextBar corresponding to this gist: https://gist.github.com/moehrenzahn/6e29d3080edb6466db7b
# By Max Melzer
open /Applications/Calendar.app; # If any line of the list is clicked, open the default Calendar app.
# The following code begins a multi-line applescript. The repeat loop makes sure that the script waits until Calendar has finished opening.
osascript -e '
set calendarDidFinishLaunching to false
repeat while calendarDidFinishLaunching is false
tell application "System Events" to set frontApp to name of first application process whose frontmost is true
if frontApp is "Calendar" then set calendarDidFinishLaunching to true
end repeat
tell application "System Events" to keystroke "t" using command down' # This simulates a press of CMD-T, which tells Calendar to jump to the current day. You could parse the title of an event and jump right to that event, but I havent implemented this functionality yet.
if [[ $TEXTBAR_TEXT == *"Neuer Eintrag"* ]] ; then # This parses the clicked line and checks if it is our link to create a new entry.
osascript -e 'tell application "System Events" to keystroke "n" using command down' # If it is we simulate a press of CMD-N, opening the quick entry pane of calendar, ready for your input.