[nettop]接続中のネットワークサービスの一覧を出力する
左側にMan出す用意してある自分用
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
set strCommandText to "/usr/bin/nettop -x -n" as text
tell application "Terminal"
launch
activate
set objTabWindows to do script "\n\n"
tell objTabWindows
activate
end tell
tell front window
activate
set numWidowID to id as integer
end tell
tell window id numWidowID
set size to {720, 870}
set position to {360, 25}
set origin to {360, 515}
set frame to {360, 515, 1080, 875}
set bounds to {360, 25, 1080, 895}
end tell
tell objTabWindows
activate
do script strCommandText in objTabWindows
end tell
end tell
set strCommandText to "/usr/bin/man -a nettop"
tell application "Terminal"
set objTabWindows to do script "\n\n"
tell front window
activate
set numWidowID to id as integer
end tell
tell window id numWidowID
activate
set size to {360, 870}
set position to {0, 25}
set origin to {0, 0}
set frame to {0, 0, 360, 875}
set bounds to {0, 25, 360, 900}
end tell
tell objTabWindows
activate
do script strCommandText in objTabWindows
end tell
end tell
return
| 固定リンク
「Terminal」カテゴリの記事
- [Terminal]新規Windowでコマンドを実行するまでの一連の流れ(2025.01.13)
- ターミナル終了(複数Window 複数tab時)(2024.12.30)
- ターミナル終了(単Window時)(2024.12.30)
- ターミナル 実行中のプロセスの終了とウィンドウを閉じる(2024.11.24)
- [Terminal]スクリプト実行後終了したらTerminalも終了する(2024.11.14)
「NetWork」カテゴリの記事
- [networkQuality]ネットワークテスト (ファイルに残せるようにした)(2024.09.07)
- 今参照しているDNS情報を取得する(2024.03.28)
- ネットワークスピードテスト(macOS14対応)(2024.03.28)
- ping実行例(2024.01.12)
- UNIXコマンドの実行(2023.12.12)