Computers should do what people want them to do - 1 minute read

Sometimes I spend time (perhaps too much time) tweaking my computer.  I do this because computers should do what people want them to do.   Customization and personalization are important when it comes to the tools that we use every day.

I have an Automator script that delays the startup of some applications that I commonly open.  Slack is one of these applications. I am frequently using my computer after-hours (tweaking code and researching), and I found that I got annoyed when Slack opens at those times because 1) I  don’t usually want to the interrupted at those times and 2) Slack is a leviathan application that takes an excessive amount of time to load.

 So I wrote my first AppleScript to fix that problem. 

I chose AppleScript because dealing with dates in bash is more difficult than it needs to be and Automator can run AppleScripts.

Here it is: enjoy!


--based on https://stackoverflow.com/questions/25334780/how-to-start-an-applescript-at-a-specific-time
--Open Slack if the time is between 8 AM and 5 PM
on run {input, parameters}
set currentTime to current date
set eightAM to 8 * 60 * 60
set fivePM to 17 * 60 * 60
if the time of currentTime is greater than eightAM and the time of currentTime is less than fivePM then
tell application "Slack"
activate
end tell
end if
return input

end run

If you have any suggestions to improve the script, please let me know!

Comments

Popular posts from this blog

Optional object property access

A short guide to cross-site request forgery attacks

How is an application like a bride's outfit? - 1 minute read