在 macOS 中掌控上下文菜单  ⌘I  获取信息

  • Yesterday on Twitter: Morten Just posted a preview of a tool that wraps ffmpeg to re-encode movies and other things to a smaller filesize. The author responded with a trick using a macOS app called ContextMenu and others mentioned using Automator with caveats.
  • Processing files through shell scripts: Use command line tools like ffmpeg. For single files, the one-line command is /opt/homebrew/bin/ffmpeg -i "$@" "${@%.*}.mp4". It assumes ffmpeg is installed with brew and the Mac is Apple silicon. For multiple files, use a for loop. To process in parallel, add the & symbol. You can convert various file types with different extensions.
  • Automator: A built-in macOS app since 2005. Setup involves creating a new Quick Action workflow, receiving current movie files from Finder, adding a Run Shell Script action, passing input as arguments, and saving with a name. It has caveats like the submenu being annoying and not easily customizing which files the menu item appears for. It stores files at ~/Library/Services/ and migrates to a new Mac.
  • ContextMenu: An app that solves issues with the Automator approach. It has options like an optional submenu, can apply to multiple types of files (including file extensions), shows output, and has confirmation before running. It stores files in its own group folder and you can specify a custom folder. It also has an updated version with more features like limiting actions to specific file extensions or UTI types.
  • Compressing a GIF: Use the gifsicle command line tool. The command /opt/homebrew/bin/gifsicle -O1 -Okeep-empty --careful "$@" > "${@%.gif}.o.gif" optimizes (compresses) an Animated GIF. You can also scale it up by a factor of 2 with /opt/homebrew/bin/gifsicle -O1 -Okeep-empty --careful --scale 2 "$@" > "${@%.gif}.o.gif".
  • Repo of shared actions: github.com/gingerbeardman/contextmenu-actions contains many useful commands like converting BIN+CUE to ISO, changing audio sample rate, converting image formats, etc.
阅读 15
0 条评论