Created
September 23, 2019 12:20
-
-
Save kopiro/7a50789f26de4e3b9414bec88da540d0 to your computer and use it in GitHub Desktop.
Slack - Multiple channels message
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
set myChannels to {"random"} # Populate this field | |
set theResponse to display dialog "What's your message?" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue" | |
set theMessage to text returned of theResponse | |
tell application "Slack" | |
activate | |
tell application "System Events" | |
repeat with theChannel in myChannels | |
keystroke "k" using {command down} | |
delay 0.5 | |
keystroke theChannel | |
delay 0.5 | |
key code 36 | |
delay 0.5 | |
keystroke theMessage | |
delay 0.2 | |
key code 36 | |
delay 0.2 | |
key code 36 | |
end repeat | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment