Created
August 4, 2025 13:23
-
-
Save cubapp/10b810800c8f45edeb941de4f0dc18ef to your computer and use it in GitHub Desktop.
Mac OS X Automator for showing SHA sums in the Finder Menu Quick Actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in Automator go for New - Quick Action | |
# Run Shell Script, Workflow receives current: "files or folders" in "Finder.app" | |
# shell Pass Input: As Arguments | |
# then the automation will be present in Finder right click Quick Actions | |
for f in "$@" | |
do | |
hash=$(shasum -a 256 "$f" | awk '{print $1}' | fold -w32) | |
button=$(osascript -e "display dialog \"File: $f\n\nSHA256:\n$hash\n\n\" with title \"SHA256 Hash\" buttons {\"Copy to clipboard\", \"OK\"} default button 2") | |
if [[ $button == *"Copy"* ]]; then | |
printf "%s" "$hash" | tr -d '\n' | pbcopy | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment