私はスクリプトを学習しているだけで、1 つのウィンドウで 13 個のタブを開くソリューションが必要です。これをウィンドウごとに実行し、タブごとに値を増やして「telnet localhost 2001」...「telnet localhost 2013」とし、各タブに名前を付けます。 R1..R1、次に SW1..SW4、次に BB1..BB3。
これは、最初と3番目の部分にはできるが、2番目にはできない方法です。
tell application "Terminal"
activate
tell application "System Events" to keystroke "n" using {command down}
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 1 of window 1 to "R1"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 2 of window 1 to "R2"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 3 of window 1 to "R3"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 4 of window 1 to "R4"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 5 of window 1 to "R5"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 6 of window 1 to "R6"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 7 of window 1 to "SW1"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 8 of window 1 to "SW2"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 9 of window 1 to "SW3"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 10 of window 1 to "SW4"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 11 of window 1 to "BB1"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 12 of window 1 to "BB2"
tell application "System Events" to keystroke "t" using {command down}
set custom title of tab 13 of window 1 to "BB3"
end tell
値のサブを実行する必要がありますが、必要に応じて動作させた後、それを処理できます。
誰かが私の問題を解決するのを手伝ってくれますか
do script ("telnet localhost 2001")
現在、各タブを開いたときに失敗しますか?