def asrun(ascript):
 osa = subprocess.Popen(['osascript', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
 return osa.communicate(ascript)[0]

def asrun ( ascript ) : osa = subprocess . Popen ( [ 'osascript' , '-' ] , stdin = subprocess . PIPE , stdout = subprocess . PIPE ) return osa . communicate ( ascript ) [ 0 ]
run the given applescript and return the standard output and error .