使用 Automator 加快工作流程
我注意到每次重新启动计算机时,我都必须执行以下任务:
- 打开终端
- 类型“cd site/mysite”
- 在终端中打开另一个选项卡
- 类型“cd site/mysite”
- 类型“script/server --debugger”
- 打开 Safari
- 转到 'http://localhost:3000/'
- 打开 TextMate
- 打开 -> mysite
是否可以使用 Automator 自动化此过程? 如果没有,有什么替代方法可以加快这个过程吗?
我尝试使用 Automator 注册此过程,但最好直接使用命令。
I noticed that every time that I restart my computer I have to do the following tasks:
- open Terminal
- type 'cd sites/mysite'
- open another tab in Terminal
- type 'cd sites/mysite'
- type 'script/server --debugger'
- open Safari
- go to 'http://localhost:3000/'
- open TextMate
- Open -> mysite
Is it possible to automatize this process using Automator? If no, there are any alternatives to speed up this process?
I tried to register this process with Automator, but would be better to use commands directly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能可以使用 Automator,我将首先尝试在 Automator 中记录它(工作流程>记录;它会告诉您需要打开的特殊 sysPreference)。
如果 Automator 不能轻松地记录它,那么 Applescript 可能会容易得多。 当一件作品需要流入另一件作品(真正的“工作流程”)时,Automator 就会大放异彩。 当它只是一堆独立的步骤时,那么 shell 脚本或 applescript 会更容易(除非 Automator 可以为您记录它)。
一些提示:
在 shell 脚本中,“open http://...”将在您首选的浏览器中打开页面。
osascript 允许您在 shell 脚本中运行小型 Applescript。
Automator 可以运行 shell 脚本和 applescripts
Applescripts 可以运行 shell 脚本。
You probably can with Automator, and I would start by trying recording it in Automator (Workflow>Record; it will tell you about the special sysPreference you need to turn on).
If Automator can't record it easily, then Applescript would probably be much easier. Automator shines when one piece needs to flow into another (a real "workflow"). When it's just a bunch of independent steps, then shell scripts or applescripts are easier (except in cases where Automator can record it for you).
Some tips:
In a shell script, "open http://..." will open the page in your preferred browser.
osascript lets you run small Applescripts within a shell script.
Automator can run both shell scripts and applescripts
Applescripts can run shell scripts.
好吧,您实际上并不需要 Automator 来完成大多数任务 - 只需为 Terminal 和 Safari 设置良好的默认值即可。
使用终端,您可以进入设置并定义几个终端窗口以在启动时运行特定脚本。 然后,您可以根据需要排列这些窗口(选项卡、窗口或两者的组合)并将结果保存为窗口组。 然后,您可以使该窗口组在打开终端时自动启动。
最后,您可以进入系统偏好设置并将 Safari 和终端设置为登录项(在“帐户”下)。
要使 Texmate 打开特定项目,您只需使用 Textmate 的命令行选项(mate mysite)即可。
Well, you don't really need Automator for most of those tasks - just setting up good defaults for Terminal and Safari.
With Terminal you can go into the settings and define a couple of terminal windows to run specific scripts when they are started up. Then you can arrange those windows however you want (tabs, windows, or a combination of the two) and save the result as a window group. Then you can make that window group automatically start when Terminal is opened.
Finally you can go into System Preferences and set both Safari and Terminal to be login items (under Accounts).
To make Texmate open the specific project, you could just use Textmate's command line option (mate mysite).