[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]新規Windowでコマンドを実行するまでの一連の流れ(2025.01.13)
- ターミナル終了(複数Window 複数tab時)(2024.12.30)
- ターミナル終了(単Window時)(2024.12.30)
- ターミナル 実行中のプロセスの終了とウィンドウを閉じる(2024.11.24)
- [Terminal]スクリプト実行後終了したらTerminalも終了する(2024.11.14)