Skip to content

Instantly share code, notes, and snippets.

@Zettt
Created September 15, 2011 14:43
Show Gist options
  • Save Zettt/1219423 to your computer and use it in GitHub Desktop.
Save Zettt/1219423 to your computer and use it in GitHub Desktop.
Extract icons from apps with a service. Add Filter Finder Items action (Kind:Apps) and Run Shell Script action with the following script.
mkdir $HOME/Desktop/AppIcons/
for CURRENTAPP in "$@"; do
APPDIR="$1"
ICON=`defaults read "$APPDIR/Contents/Info" CFBundleIconFile|sed -e 's/\.icns$//'`
ICONFILE="$APPDIR/Contents/Resources/$ICON.icns"
APPNAME=`basename "$APPDIR" .app`
OUTFILE="$HOME/Desktop/AppIcons/${APPNAME}.icns"
cp -f "$ICONFILE" "$OUTFILE"
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment