0

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.

4

2 回答 2

1

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.

于 2009-06-21T13:56:34.073 回答
1

好吧,您实际上并不需要 Automator 来完成大多数这些任务 - 只需为终端和 Safari 设置良好的默认值即可。

使用终端,您可以进入设置并定义几个终端窗口以在启动时运行特定脚本。然后,您可以随意排列这些窗口(选项卡、窗口或两者的组合)并将结果保存为窗口组。然后,您可以使该窗口组在终端打开时自动启动。

最后,您可以进入系统偏好设置并将 Safari 和终端设置为登录项(在帐户下)。

要让 Texmate 打开特定的项目,您可以使用 Textmate 的命令行选项(mate mysite)。

于 2009-06-21T14:07:48.203 回答