Use native do-applescript function instead of osa

No shell interaction means it'll run faster.