--選択した語句でgoogle検索 set cb to the clipboard as record tell application "System Events" tell application process "Safari" tell application "Safari" to activate delay 0.5 keystroke "c" using command down delay 0.5 set surl to the clipboard end tell end tell set the clipboard to cb if surl contains return then set surl to do shell script "echo " & quoted form of surl & " | sed s/" & return & "//g" if surl contains " " then set surl to do shell script "echo " & quoted form of surl & " | sed s/" & quoted form of " " & "/" & quoted form of "+" & "/g" tell application "Safari" open location "www.google.com/search?client=safari&rls=ja-jp&q=" & surl & "&ie=UTF-8&oe=UTF-8" end tell