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?
-
1If you find the script corresponding to the service, you can just drag it onto the finder toolbar.– alexisCommented 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)– ra9rCommented Jun 14, 2016 at 2:52
Add a comment
|
1 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.
-
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 getcommand not found
. I suspect that the osascript command is not present.– ra9rCommented Jun 14, 2016 at 2:42