I no longer maintain this software. It might still be useful for you, but I can't provide help for it.
This collection of components for OS X allows you to automatically and unobstrusively restart Slack periodically.
The AppleScript Restart Slack if Not Frontmost.scpt
handles the task of restarting Slack. It takes care not to restart Slack when its window is focused on screen. While you're focusing on something else, Slack can restart without loss of data.
It depends on Slack being installed at /Applications/Slack.app
, which is the normal spot for it.
cdz.restartslack.plist
is a Launch Agent which schedules the periodic task of restarting Slack.
Place the file Restart Slack if Not Frontmost.scpt
in a directory like ~/Applications
.
Place the file cdz.restartslack.plist
in ~/Library/LaunchAgents
. You’ll first want to edit it so that it points to the correct Restart Slack if Not Frontmost.scpt
path.
Run the command launchctl load cdz.restartslack.plist
to set up the task.
Run the command launchctl unload cdz.restartslack.plist
to unload the task. Then remove Restart Slack if Not Frontmost.scpt
from ~/Applications
, and cdz.restartslack.plist
from ~/Library/LaunchAgents
.
- A
launchd
Tutorial launhctl(1)
- Lingon can be used to create, edit, and manage launch agent plists.
The Unlicense; see LICENSE.txt
.