Safari Part59

このエントリーをはてなブックマークに追加
882名称未設定
>>790
検索結果を新規ウインドウで開くAppleScript
ドックに入れておいて、文字選択後クリック
有り物をSafari5.1用に一寸改ざんなのでタブ用には
誰か手直ししてくれ

-- Safariで選択したテキストをGoogle検索するAppleScript
tell application "Safari"
set the_str to do JavaScript "unescape(getSelection())" in document 1
if the_str is "" then return
set the_key to do shell script ("
/bin/echo -n " & quoted form of the_str & " |
ruby -rcgi -Ku -ne 'print CGI.escape($_)'
")
open location ("ttp://www.google.com/search?hl=ja&q=" & the_key & "&lr=lang_ja")
end tell