Open MrDesjardins opened 2 years ago
For people having the same issue, instead of using the slack applescript library, I wrote an AppleScript that performs mostly what this library is trying to perform. It's my first AppleScript so, might not be the best code (got an issue with space that I fixed by explicitly sending 49
but it works.
tell application "Slack"
activate
end tell
tell application "System Events"
keystroke "/"
keystroke "update"
key code 49
keystroke "your"
key code 49
keystroke "status"
delay 1
key code 76
delay 1
set textBuffer to "Hello world!"
repeat with i from 1 to count characters of textBuffer
if character i of textBuffer = " " then
key code 49
else
keystroke (character i of textBuffer)
end if
delay 0.05
end repeat
delay 0.1
key code 76
end tell
Thanks for assisting others @MrDesjardins
What do you think is causing the issue from my library - I've assumed in the past it's a timing issue
Hello,
Running the following AppleScript:
I see Slack coming up and executing the
/
but at some point it fails with the following Slackbot message:I see in the Events window:
I am running the script with the ScriptEditor on macOS Monterey 12.1
Thanks for script, and let me know if there is something I am not using properly.