How to add Service to Finder Toolbar

finder

In the contextual menu (right click) on a folder or file object in the finder will give you the option to select "Services". I wonder if there is some way to move those services into a button on the toolbar. In particular I would like to add "New Terminal at Folder" to the toolbar. Anyone have any idea how to do this?

Best Answer

You can create an application doing exactly this using ScriptEditor.app and then add it to Finder Toolbar.

First place this line inside your ~/.bash_profile file:

alias cdf="eval \"cd \\\"\\\`osascript -e 'tell app \\\\\\\"Finder\\\\\\\" to return the POSIX path of (target of window 1 as alias)'\\\`\\\"\""

This will change the active directory to the one of the topmost Finder window.

Then create an application in ScriptEditor.app like:

tell application "Terminal"
    do script "cdf"
    activate
end tell

Save this as an application and add it to the Toolbar with ⌘ CMD + Drag.