samknight/slack_applescript

Respect hidden Slack during operation

Opened this issue · 1 comments

	tell application "System Events"
		set visible of application process "Slack" to false
	end tell

Sending a message in the above context seems to make Slack visible again. Can this be avoided?

Thanks for sharing this script - I hadn't found a way to get this to work in the background before but I think this might be solution to a lot of problems.

I've done some testing today and found that I still need to precede setting th visibility to false with

tell application "Slack"
activate
//set visibility
//send commands
end tell

This has the problem of:
1: Flashing Slack onto the screen initially
2. having to reset the visibility status inside of each command in my script

Do you have any suggestions on how I can solve this?