Select options, then find and click 'New Terminal at Folder. Head to the Finder in the bottom-right corner of your Mac desktop. ![]() So, heres what youre going to do: Step 1. You can open Get info on the Terminal app in the Utilities folder, and drag its icon to the top-left small icon to assign that icon to our new little app.įinally keep the ⌘ command key pressed and drag the app in the Finder toolbar. This method requires you to navigate your mouse and keyboard and open Terminal on Mac. Save this application in the Applications folder and then click Get Info to change its icon. Then we open the Terminal app and we run the cd command to go into that folder. Which basically gets the current opened folder absolute path and stores it to the myPath variable. ![]() The first runs osascript (which is a script to run AppleScript) with the following AppleScript tell application "Finder" set myPath to (POSIX path of (target of front window as alias)) end tell If you prefer you can use “Run Shell Script” instead, and write this bash script: osascript -e ' tell application "Finder" set myPath to (POSIX path of (target of front window as alias)) end tell tell application "Terminal" do script "cd " & myPath activate end tell ' The command to open the current folder from terminal is: Open. ![]() Search for “Run AppleScript” in the list of actions, and paste these lines: on run tell application "Finder" set myPath to ( POSIX path of (target of front window as alias )) end tell tell application "Terminal" do script "cd " & myPath activate end tell return input end run Open current folder in Finder from Terminal. I decided to make it easy by adding an “Open in Terminal” icon in the Finder: Let’s say I’m in the Finder, I open a folder and I want to open it in the Terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |