The longer I work in tech, the simpler and more reliably I like my tools.

  • Alex Chan’s post on her nifty hacks to move between Finder and Terminal did remind me again that Apple Script can read the files that are currently selected in Finder.

    While I already knew that from dissecting the built-in scripts that come with DevonThink, I somehow never made the connection to invoke it in a sub-shell and to use it together with other commands/tools.

  • Miles Cranmer tweets Rust alternatives to various tools.

    The apps these replace are mostly written in C and are already plenty fast, but if this trend continues perhaps there will be small Rust replacements for stuff that currently ships as npm package with a metric ton of dependencies.

  • flip_h by yours truly, now adapted to macOS:

    flip_h() {
          # Filename extraction https://stackoverflow.com/a/965069
          TMPFILE="${1%%.*}.tmp.${1##*.}"
    
          case "${1##*.}" in
          mp4|avi)
                  handbrake-cli -i "$1" --rotate=hflip=1 -o "$TMPFILE" && rm "$1" && mv "$TMPFILE" "$1"
                  ;;
    
          jpg|jpeg|png)
                  sips -f horizontal "$1"
                  ;;
          esac
    }
    

    Btw, sips is a really versatile tool to keep handy in and of itself.