Applescript:带有主题 pro 的新终端窗口
我想创建一个脚本,打开一个主题为 pro 的新终端窗口。该脚本会是什么样子?我刚刚设法获得一个新窗口,但我想指定主题。
我为此创建了一个自动化服务,因为我想使用快捷方式。
我需要主题的属性或从中获取信息,以某种方式重建它。
这样效果很好:
将模式设置为 {"Basic", "Grass", "Novel", "Ocean", "Pro", "Red Sands"}
将 I 设置为从 1 到 6 的随机数
将主题设置为模式的第 I 项
但是如何获取当前主题?脚本完成后是否会丢失所有变量,或者是否以某种方式保存它?
I want to create a script which opens me a new terminal window with the theme pro. how would that script look like? I just managed to get a new window but I want to specify the theme.
I created a automator service for that, cause I want to use shortcuts.
I would need a propertie for the theme or get the infos out of it, somehow for rebuilding it.
So that works fine:
Set mode to {"Basic", "Grass", "Novel", "Ocean", "Pro", "Red Sands"}
set I to random number from 1 to 6
Set theme to item I of mode
But how can I get the current theme? And does the script loos all its vars after its finished or does it somehow save it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这应该可以:
不过不确定你的意思是什么:
This should do:
Not sure, what you mean by this, though:
我编写了这个 applescript,以便我可以轻松设置当前窗口的主题。它允许我设置一个特定的主题,从一组受祝福的主题中随机设置一个,或者从所有可用的主题中随机设置一个。
我在 .bashrc 中使用别名设置来轻松从命令行调用它。示例位于标题中。
I wrote this applescript so that I could easily set the theme of the current window. It allows me to set to a specific theme, a random one among a blessed set, or randomly among all available.
I uses aliases setup in my .bashrc to easily invoke this from the command line. Examples are in the header.