Fixed the stdout issue of osascript.