Applescript 打开特定终端样式窗口
好吧,事情就是这样。我希望每项工作都有不同风格的终端窗口。每个人都会有不同的工作,即,一个人将通过 ssh 连接到一个站点,另一个窗口连接到其他地方,等等。
所以我想这可以通过一些 Applescripting 来完成?
问题是有一些苹果脚本可以打开不同的终端窗口。然后将每个 applescript 添加到快捷方式。
有什么想法吗?
谢谢 :)
Ok, so the thing is. I want to have different style terminal windows for each job. Each one will have a different job, i.e. , one will connect through ssh to a site, other window to other place, etc.
So I guess this could be done with some Applescripting?
The thing would be to have some applescripts that opens a different terminal window. And then add each applescript to a shortcut.
Any ideas?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在终端中设置一个窗口组怎么样?
打开您想要的所有终端窗口 -->壳牌-->显示检查员。在“设置”下,您可以更改每个终端窗口的主题。
窗口-->将 Windows 另存为组
在首选项中设置启动选项以显示组。
http://img18.imageshack.us/img18/9681/screenshot20111018at110.png
http://img542.imageshack.us/img542/9681/screenshot20111018at110.png
如果您想使用 Applescript 设置窗口的主题,您可以首先需要使用此 applescript 获取所有主题的 id:
这将输出 id # 和主题名称的数组。接下来要创建一个新窗口,请使用以下命令:
How about setting up a Window group in terminal ?
Open all Terminal windows you want --> Shell --> Show Inspector. Under Settings you can change the theme of each terminal window.
Window --> Save Windows as Group
In preferences set the startup option to display the group.
http://img18.imageshack.us/img18/9681/screenshot20111018at110.png
http://img542.imageshack.us/img542/9681/screenshot20111018at110.png
If you want to use Applescript to set a window's theme you first need to get the id's of all the themes you have using this applescript :
This will output an array of id # and the theme's name. Next to create a new window use the following :
告诉应用程序“系统事件”告诉进程“终端”点击菜单栏1的菜单栏项“Shell”的菜单1的菜单项“新窗口”的菜单1的菜单项“草”
tell application "System Events" to tell process "Terminal" to click menu bar 1's menu bar item "Shell"'s menu 1's menu item "New Window"'s menu 1's menu item "Grass"