wrote an applescript