Updated apple script.