automator来解决mac terminal终端快速连接
2017-02-12 20:46
866 查看
因最近网络不太稳定,远程连接的ssh服务有时会断掉,于是在网上参考了一些mac terminal终端快速连接的办法,最后选择使用automator来解决。
下面是antomator 服务的使用方法,并附有一段可运行代码
1、新建服务
2、将服务绑定到终端
3、一段AppleScript代码
on run {input, parameters} tell application "Terminal" activate do script "" set Terminal to front window set tab1 to tab 1 of Terminal # 窗口1中输出 do script "echo 1" in tab1 # 或者ssh登录 # do script "ssh ***" in tab1 # delay 1 #延迟 1 秒 # do script "..." # 如果标签2不存在则创建 if not (exists tab 2 of Terminal) then tell application "System Events" keystroke "t" using command down #相当于 command+T end tell set tab2 to tab 2 of Terminal end if # 窗口2中输出 do script "echo 2" in tab2 # 或者ssh登录 # do script "ssh ***" in tab2 # delay 1 # do script "..." end tell return input end run
4、进入终端服务修改快捷键
相关文章推荐
- Mac环境下终端(Terminal)用ssh 连接服务器问题 Received disconnect from 120.55.x.x: 2: Too many authentication failures for root
- mac终端top命令后,显示Error opening terminal: xterm-colorH.解决方法
- Mac终端出现“terminal pointer being freed was not allocated…”解决办法
- 解决MAC OS X 终端(Terminal)启动慢
- 解决服务器重装系统导致的mac终端无法连接的问题
- 解决MAC终端ssh连接服务器,空闲断线的办法
- Mac OS X上的终端bash没有读取~/.bashrc的原因和解决办法
- MAC下使用terminal连接到Parallel创建的Linux虚拟机
- 远程桌面连接时提示终端服务器超出了最大允许连接数解决方法小结
- SecureCRT连接Linux,终端显示中文乱码问题,全方面解决
- Mac 终端命令连接mysql
- mac终端(terminal)里的快捷键
- Mac下Android真机调试,连接不上设备的解决方法
- 快速修改网卡物理地址&MAC地址全为FF解决方法
- Mac 终端Terminal光标移动快捷键
- Mac下PHP连接MYSQL报错"No such file or directory"的解决办法
- Mac OS X Terminal 101:终端使用初级教程
- windows 下面解决远程终端连接已经超过
- 远程桌面 终端服务器超出了最大连接的解决方法
- 快速开发平台ES2007_FIX主题不能添加URL连接的解决办法