制作一个小脚本,通过终端中的 USB 到串行连接将我连接到某些 cisco 设备上的控制台。
但是我发现在文本和变量之间放置换行符或返回是不可能的(比如在 HTML 中使用 <br> )。因此,在显示对话框行中,所有文本都混合在一起。
我尝试使用 \n , \ \n ,将首选项更改为格式 > 转义选项卡和字符串中的换行符 > 检查。
所以任何帮助将不胜感激。
set theFind to "ls /dev/tty.*"
set theResult to do shell script theFind
set theConnection to text returned of (display dialog "Serial interface to availble:" & theResult & "Interface to use:" default answer "/dev/tty.usbserial")
tell application "Terminal"
activate
tell application "System Events"
delay 1
keystroke "screen " & theConnection & " 9600"
keystroke return
beep
end tell
end tell