-
-
Save evansde77/312f85478799f80af501 to your computer and use it in GitHub Desktop.
Applescript that creates a new sticky with a colour based on a command line priority value, example usage: osascript /Users/david/Documents/open-sticky.scpt high "update monitoring for replication"
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
on run argv | |
set card_prior to item 1 of argv | |
set card_text to item 2 of argv | |
if card_prior is equal to "high" then | |
set colour to "pink" | |
else if card_prior is equal to "medium" then | |
set colour to "blue" | |
else if card_prior is equal to "low" then | |
set colour to "green" | |
else | |
set colour to "yellow" | |
end if | |
tell application "Stickies" to activate | |
tell application "System Events" | |
tell process "Stickies" | |
tell window 1 | |
delay 1 | |
keystroke "n" using command down | |
tell scroll area 1 | |
set value of text area 1 to card_text | |
delay 0.5 | |
end tell | |
end tell | |
click menu item colour of menu "Color" of menu bar 1 | |
end tell | |
end tell | |
end run |
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
function new-card { | |
local PRIORITY="${1}" | |
shift; | |
local CONTENT=$@ | |
osascript $HOME/Documents/open-sticky.scpt $PRIORITY "$CONTENT" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment