"Open in Terminal" should cd in the terminal drawer

Marc Riedel's Avatar

Marc Riedel

07 Apr, 2013 06:16 PM

I can see that several people have requested the following feature: "Open in Terminal" command should cd to the current folder in a new tab in Terminal (or iTerm2) instead of opening a new window.

Is there a way to have "Open in Terminal" cd to the current folder in the terminal drawer?

Many versions of Pathfinder back, I had a pair of useful scripts (taken from this page, I believe: http://hints.macworld.com/article.php?story=20050413201826795). The script pft would change the Pathfinder folder to the current terminal directory, and the script pff would change the terminal directory to the current Pathfinder folder. I would use these all the time when working in the terminal drawer. As of Pathfinder 5 or 6, these scripts are broken. The scripts are copied below. It would be great if someone could repair them.

--Marc

(* Name:
pff.scpt Description:
Script to obtain Path Finder's front window/tab current path. Usage:
CURRENT_IN_PF=$(osascript /path/to/this/script) Example (bash):
cd $(osascript ~/pff.scpt) See Also:
pft.scp Author:
Daniel Berstein [email blocked] Last Modified:
2007-06-20 ) tell application "Path Finder"
(
Find fron window/tab ) set the window_list to the finder windows set the front_window to item 1 of window_list set the containee to the target of the front_window set the_path to POSIX path of the containee ( Return the path *) return the_path end tell

(* Name:
pft.scpt Description:
Script to command the front Path Finder window/tab to a given path. If no Path Finder window is found, a new one is opened. Most useful for syncronizing the PWD of a terminal session with Path Finder. Usage:
osascript /path/to/this/script /new/path/to/use/in/path/finder Example (bash):
osascript ~/pft.scpt $(pwd) See Also:
pff.scpt Author:
Daniel Berstein [email blocked] Last Modified:
2007-06-20 ) on run the_path
tell application "Path Finder" (
Find front window/tab ) activate set the window_list to the finder windows if (count of window_list) is greater than 0 then set the front_window to item 1 of window_list set the containee to the target of the front_window ( When the new path is not directly reacheable from the current view, like when traversing sibling directories, PF cannot make the switch in a single step. The workaround is to repeat the procedure twice. ) set path_found to false set max_tries to 2 repeat until path_found or max_tries is equal to 0 ( Select in PF the new path ) select the_path if (count of selection) is not 0 then ( Using selection so we can get an fsItem ) set selection_list to selection repeat with the_item in selection_list set target of the item 1 of the finder windows to the_item end repeat set path_found to true else set max_tries to max_tries - 1 end if end repeat ( If PF cannot find/reach the location (ie. /etc), inform user ) if not path_found then display dialog "Path Finder cannot reach " & the_path activate end if else ( Open a new Path Finder window if none is found *) PFOpen the_path end if end tell end run

  1. 1 Posted by Tom on 15 Apr, 2013 06:49 PM

    Tom's Avatar

    Hi Marc,

    Thanks for checking in with us about this issue. I'm going to pass this along to our dev team right away, and get this issue addressed in a future update.

  2. Tom closed this discussion on 15 Apr, 2013 06:53 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac