# Generate QR code macOS quick action open in Preview.app #qrencode #automator A little automator script for adding a right click menu Services -> "Generate QR Code and open in Preview" `brew install qrencode` cli for creating QR code. (`brew info qrencode`) Open Automator.app -> Add a new Quick Action (service) -> Add "Run Shell Script" ```sh dir="$(mktemp -d)" # create a temporary directory file="$dir/QR-$(date +%Y%m%d-%H%M%S).png" # filename with timestamp in it /opt/homebrew/bin/qrencode -o "$file" # generate QR code and save to the file open "$file" # open the PNG file (with Preview.app by default) ``` Chrome has this feature for URLs, but only for https. Which is problematic when you want to view a page on a mobile phone while using a server without https. It could be taken a step further to also find the local network ip address. 🤔 that could be a different quick action that replaces the selected text. I have an alias `ip="ifconfig | grep -E '192' | cut -c7- | cut -d ' ' -f1"` for finding my local network ip address. You can also hold `Option` will clicking on Wifi symbol to see your local network ip address.