« [Terminal] sudo | トップページ | [networkQuality]ネットワークスピードテスト »

[Terminal] 選択範囲をコピーして検索

Google翻訳

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

tell application "System Events"
tell process "Terminal"
keystroke "c" using command down
end tell
end tell
tell application "Finder"
set theText to the clipboard as text
end tell


set theURL to ("https://translate.google.com/?sl=auto&tl=ja&op=translate&text=" & theText & "") as text




tell application "Safari"
launch
activate
make new document with properties {name:"translate.google.co.jp"}

tell window 1
activate
open location theURL
end tell

end tell



Google検索

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

tell application "System Events"
tell process "Terminal"
keystroke "c" using command down
end tell
end tell
tell application "Finder"
set theText to the clipboard as text
end tell

set theURL to ("https://www.google.com/search?hl=ja&as_q=" & theText & "") as text

tell application "Safari"
launch
activate
make new document with properties {name:"search.google.co.jp"}

tell window 1
activate
open location theURL
end tell

end tell

|

« [Terminal] sudo | トップページ | [networkQuality]ネットワークスピードテスト »

Terminal」カテゴリの記事