views:

397

answers:

2

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.

+1  A: 

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.

Rob Napier
+1  A: 

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).

Branden Hall