More apple script corrections