Launchd Task Scheduler and Task Editor for Mac OSX

Download

Available_on_the_Mac_App_Store_Badge_US-UK_165x40_0824

Video Walkthrough / Demo

Overview

LaunchD Task Scheduler is a simple to use task scheduler for your Mac.

It can start an app, command or script automatically at any schedule you choose.

It can run tasks based on Mac events and will even restart a task on the event of a crash.

The UI is simple to use and can quickly create a task but it is also backed with complex features if required. Such as the ability to have tasks run with I/O priority reduced and nice levels.

I wrote this application after being disappointed with a similar application I had paid for. The application I paid for cost too much money, didn’t function correctly and didn’t include the advanced features of this application.

Features

  • Create / Edit / Delete tasks
  • Create tasks to run at intervals, once a day, once a week, once a month
  • Run applications or scripts
  • Provide arguments to applications or scripts to be run
  • Create tasks to run on an event
      • When a volume is mounted
      • At login
      • Run on modification of a folder including empty ones
      • Keep a task running and restart it if it crashs
  • Specify working directory for a task
  • Specify a root directory for a task
  • Redirect stdout, stdin, stderr
  • Set the nice level of a task
  • Force low priority I/O for a task
  • Enable globbing

I think you will agree that is a large feature set!

Walkthrough Gallery of Features

The image gallery below provides a walk through of the simplicity of the tools and shows off its features. Click image to enlarge.

launchd task scheduler main screen
launchd task scheduler main screen
launchd task scheduler new and edit task screen
launchd task scheduler new and edit task screen
launchd task scheduler extras screen, complicated options
launchd task scheduler extras screen, complicated options
launchd task scheduler showing off simplicity
launchd task scheduler showing off simplicity

FAQ

Upon first run of LaunchD Task Scheduler I cannot find the ‘Library/LaunchAgents’ folder and get a ‘Cannot Continue’ warning

It is likely the folder is being incorrectly selected. Make sure you are selecting ‘/Users/<USERNAME>/Library/LaunchAgents’ folder.

If in doubt, press SHIFT+COMMAND+G and type ~/Library/LaunchAgents and select ‘Go’ and then ‘Open’.

Older Versions of OSX, Lion:

This is a known issue with Lion where sometimes the /Library folder is hidden from Applications.

To fix:

  1. Open a terminal, Command+Space, type Terminal and press enter, then execute step 2 & 3 in the terminal
  2. chflags nohidden ~/Library
  3. mkdir ~/Library/LaunchAgents
  4. Run the command above and then re-launch LaunchD Task Scheduler

Main reasons a script won’t run

  1. Incorrect permissions on the script (see additional FAQ below)
  2. Script is executing an application bundle and not the application (see additional FAQ below)
  3. Script requires root permissions

“My script doesn’t run why is your application not running it?”

LaunchD Task Scheduler creates the job for launchd to schedule. Launchd is an Apple user daemon. Launchd does however provide hints to why your script may not be running.

The first step to diagnose any issues is to check the console for any messages from launchd.

Load ‘console’ (mac key + space and type ‘console’) and then search for the name of your job.

You may then see hints like ‘Job failed to exec(3) for weird reason: 13’, the solution for this particular error is listed below.

Launchd can be picky but with the log files and google will be able to fix your script to correctly operate.

My AppleScript will not run

You must enter osacript which is the application needed to run your script in the program/script box and ensure ‘arguments’ is checked. E.g.

osascript /yourpath/yourscriptname.scpt

Don’t forget this script will also need execute permissions as the user! (chmod +x /yourpath/yourscriptname.scpt)

Job does not load and I see “Job failed to exec(3) for weird reason: 13” in the console:

An osx app is actually a bundle (read folder), execute the binary from this bundle in /Applications/AppName.app/Contents/MacOS/AppName not just AppName.app, assuming your app bundle is in /Applications.

My Job still doesn’t run?

If you are executing a script (.sh) this script must have execution permissions!

‘chmod +x script.sh’ from the terminal.

Support

Known Issues (affect a very small amount of users):

 

Two possible reasons:

  1. Preferences have become corrupt
  2. LaunchD Folder does not exist

Preferences have become corrupt

Please delete the preferences file.

  1. Open a terminal, command + space, terminal
  2. type the following (replacing <USERNAME> with your username
  3. rm -rf ~/Library/Containers/Barker.LaunchD-Task-Scheduler/*

LaunchD Folder does not exist

There is currently an issue with creating LaunchD tasks if the underlying system folder has been removed or does not exist (it should always exist).

If you experience this issue please follow the fix:

Fix

  1. Open a terminal window (Command + space and type terminal and press enter)
  2. paste the following: mkdir ~/Library/LaunchAgents
  3. Close terminal and rerun LaunchD Task Editor.


Contact Support

If for any reason you experience issues with this application or have feature requests then feel free to contact me and I will get back to you promptly.

[LaunchD [at no spam] barkersoftware.com]