![sleepwatcher mac run when idle sleepwatcher mac run when idle](https://ellescatering.com/wp-content/uploads/2015/03/delta-living-magazine.jpg)
The way a stay-open script works is there's 2 main handlers, the 'on run' and the 'on idle'. Save it as an application and check the 'stay open' box to make it stay open after you launch it. This indicates an automation workflow is running. So here's an example applescript for you. The only side-effect will be that while it's running, your menu bar will have a spinning gear over in the tray area next to the clock.
![sleepwatcher mac run when idle sleepwatcher mac run when idle](https://www.profootballrumors.com/files/2016/08/USATSI_9422566.jpg)
![sleepwatcher mac run when idle sleepwatcher mac run when idle](https://fabwags.com/wp-content/uploads/2017/09/Darren_Mcfadden_Wife_Tita_McFadden_photos.jpg)
On my Mac right now (early 2016), running python 2.7.10, it is "idle2.7" You'll need to know the terminal command to open your version of IDLE.As mentioned by other commentators, this probably isn't necessary for Python 3, as it creates a shortcut automatically, and some hand-installed versions have tools to do this automatically. The way to produce the same result in Automator, is pictured below, but doesn't have the option of of repeating every x number of minutes, but hopefully the picture shows the workflow steps needed to duplicate the above script.One way to run IDLE from spotlight or an icon in the Applications folder is to build a quick Automation for it. Which you can right click and view the package contents, which will have a proper "ist" file, and an ".icns" icon file that you can change to your own custom icons, along with other options to grow and develop the application.
#Sleepwatcher mac run when idle full#
The good thing about going the stay open application route, is that you have a full standalone application package.
#Sleepwatcher mac run when idle code#
In the example code above, if you click the "Cancel" button while picking from the list, this returns a "false" boolean value, so the idle handler returns 1 second, which means the choose from list dialog box will display immediately.īut if you choose one of the options from the list, the idle handler will return a value of 1800 seconds, which is the equivalent of the 30 minute you desired, but can be set to any value you want. This will create the stay open AppleScript application, if you double click this application as usual, it will run like any other application, except the idle handler will repeat with the returned number of seconds. Then you need to click the "File Format:" combo box near the bottom, and select the "Application" option, and then also select the "Stay open after run handler" option box. To save it as a stay open application, go to the "File" menu in Script Editor, and then click the "Save" menu item.Īnd the usual file save dialog box will be displayed, so give your application a name, I called mine "Shell Runner". You will also notice that it will run only once in the Script Editor application, this is because for the idle handler to function, the script needs to be saved as a stay open application, only then will the idle handler repeat with the desired return value, which is the number of seconds between repeat runs of the application. If you copy and paste this code into a new "Script Editor" file and click the run button, you will see how it works. If button returned of quitApplication is "Yes" then Set commandVariable to choose from list default button "Yes"