Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It took me a while but I finally got open to open folders in a new Finder tab instead of opening a new window each time.

     function opent () {
        what=${1:-`pwd`}
        what=$(cd "$what"; pwd)
        osascript -e "tell application \"Finder\"
        activate
        set t to target of Finder window 1
        set toolbar visible of window 1 to true
        end tell
        tell application \"System Events\"
        keystroke \"t\" using command down
        end tell
        tell application \"Finder\"
        set target of Finder window 1 to POSIX file \"$what\"
        end tell" > /dev/null
    }

    ## opens current dir
    $ opent .
    ## same
    $ opent


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: