7

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?

2
  • 1
    If you find the script corresponding to the service, you can just drag it onto the finder toolbar.
    – alexis
    Commented Jun 10, 2016 at 23:22
  • @alexis that is true, but for the life of me I cannot find it in the usual places (e.g. /System/Libarary/Services)
    – ra9r
    Commented Jun 14, 2016 at 2:52

1 Answer 1

4

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.

1
  • So first off, once in the tool bar, when clicked, all that happens os the script is opened in ScriptEditor.app instead of running the alias cdf. When I try to run the alias at the terminal directly, I get command not found. I suspect that the osascript command is not present.
    – ra9r
    Commented Jun 14, 2016 at 2:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .