News for hackers. Stuff that matters.
Re:My next Mac might be the last by Ancapistani on Monday October 24, 2022 @06:24PM (#33323444)
I have something that serves a similar purpose - a shell script that calls out to AppleScript to get the path of the most recently used Finder window and returns it as a string:

    #!/usr/bin/env bash
    
    ####################
    # Description: Get the path of the most recently used Finder window
    # Author: Ancapistani
    # Version: 1.0.0
    ####################
    
    osascript -e 'tell application "Finder"'\
              -e "if (${1-1} <= (count Finder windows)) then"\
              -e "get POSIX path of (target of window ${1-1} as alias)"\
              -e 'else' \
              -e 'get POSIX path of (desktop as alias)'\
              -e 'end if' \
              -e 'end tell';
I have this saved as `fpwd` in my shell.
Re:My next Mac might be the last by cute_boi on Monday October 24, 2022 @10:59PM (#33325644)
the problem with such approach is it leaves terminal item in dock. I use warp terminal and it is really annoying.