Mac version of the script