Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I find myself doing this too often - navigate to a folder, "Open Terminal Here", then "mate .", then "python -m SimpleHTTPServer"

I was wondering if it's possible to add a button to the finder toolbar that when I click it runs those two commands for me for the folder that I'm currently in?

Thanks

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

The following AppleScript should work, which you can save as an application and put in your Finder toolbar.

tell application "Finder"
    try
        set folderPath to (quoted form of POSIX path of (target of front window as alias))
        tell application "Terminal"
            do script "cd " & folderPath & "; mate .; python -m SimpleHTTPServer"
        end tell
    end try
end tell
share|improve this answer
    
worked like magic :P thanks! –  Nikolay Dyankov Feb 13 '12 at 4:22
add comment

There are several apps like TextExpander that can do the text input for you. Another option might be to add a text substitution into the Language & Text System Pref under the Text pane.

There's a free Automator action, Open Terminal Here that seems like it should accomplish the first part.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.