Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Away command clashes with similar hubspot command #40

Open
dennisnewel opened this issue May 30, 2023 · 0 comments
Open

Away command clashes with similar hubspot command #40

dennisnewel opened this issue May 30, 2023 · 0 comments

Comments

@dennisnewel
Copy link

The current "set away" command effectively enters "/away" and hits enter. The issue I had was that on my work instance, another command had the name "away" in it, and it was listed higher in the popup for slack commands, which mean it would get picked instead of the built-in "/away" command.

I fixed it by adding a space before hitting enter, as that would get rid of the popup with the other option. The resulting "shortcut" function looks like this:

on shortcut(cmd, msg)
	tell application "Slack"
		activate
		tell application "System Events"
			keystroke "/"
			delay 0.5
			keystroke cmd
			delay 0.5
			if (cmd is equal to "away" or cmd is equal to "active") then
				key code 49
				delay 0.5
				key code 36 using {command down}
			else
				key code 36 using {command down}
			end if
			if (msg is not equal to "") then
				key code 49
				delay 0.5
				keystroke msg
				delay 0.5
				key code 36 using {command down}
			end if
		end tell
	end tell
end shortcut

On another note, "set do not disturb" i.e. shortcut("Pause all your notifications","") didn't work at all for me; it would just leave the text in input field. "set do not disturb for 25 minutes" did work though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant