[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」カテゴリの記事
- [Terminal]コマンドを1つのWindow内で実行するドロップレット(2025.05.09)
- ターミナル実行終了したら閉じる(2025.05.02)
- 選択中のスクリプトをターミナルで実行するTerminal(2025.04.09)
- スクリプトをターミナルで実行するv2(bash等にも対応)(2025.03.06)
- ターミナルウィンドウのならびかえ(2025.02.28)