updated apple script