Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created September 23, 2019 12:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopiro/7a50789f26de4e3b9414bec88da540d0 to your computer and use it in GitHub Desktop.
Save kopiro/7a50789f26de4e3b9414bec88da540d0 to your computer and use it in GitHub Desktop.
Slack - Multiple channels message
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