Make applescript implementation readable