After learning about Album Art Exchange
(http://www.albumartexchange.com/) in this Forum, I needed an easier
way to add the artwork to my Flac files in OS X.  I was unable to find
an Apple App that I liked to do the work, so I just wrote a simple
Automator Service to do it.  (You must have FLAC installed for this to
work (http://sourceforge.net/projects/flac/files/flac-darwin/)

To use this Service, first d/l the Art to your Desktop, then in Finder
Highlight the FLAC files, Control-click and select "Services->FLAC -
Import Album Art" and the Artwork will be added to the FLAC files.

Just open Automator (Applications->Automator), select "Service", then
Utilities, and drag Run Shell Script to the right pane.  Select
"Service receives selected  Audio Files in Finder.   Select "Pass input
as arguments"  (see attached file for example).

Now, input the following code (replacing the example that's there) and
save as "FLAC - Import Album Art" (or any name you want):

Code:
--------------------
    
  count=0
  for f in "$@"
  do
        if [ -e "$f" -a "${f##*.}" = "flac" -o "${f##*.}" = "FLAC" ] ; then
                flacfile[count]="$f"
                let count++
        fi
  done
  if  [ $count -gt 0 ] ; then
        jpegImage=$(/usr/bin/osascript <<-EOT
        try
                tell application "Finder"
                        activate
                        POSIX path of (choose file of type "public.jpeg" with 
prompt "Select jpeg image to import to FLAC files:" default location path to 
desktop folder)
                end tell
                on error
                        "UserCancelled"
        end try
        EOT)
        if [ "$jpegImage" != "UserCancelled" ] ; then
        /usr/local/bin/metaflac --preserve-modtime --remove 
--block-type=PICTURE "${flacfile[@]}"
        /usr/local/bin/metaflac --preserve-modtime 
--import-picture-from="$jpegImage" "${flacfile[@]}"
        fi
  fi
  
--------------------


To use this Service, first d/l the Art to your Desktop, then in Finder
Highlight the FLAC files, Control-click and select "Services->FLAC -
Import Album Art" and the Artwork will be added to the FLAC files.


+-------------------------------------------------------------------+
|Filename: Screen shot 2011-05-21 at 12.56.24 PM.jpg                |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=11881|
+-------------------------------------------------------------------+

-- 
Tony T

Tony
&#63743;  SBTouch &#9834; SBRadio &#9836;
------------------------------------------------------------------------
Tony T's Profile: http://forums.slimdevices.com/member.php?userid=34544
View this thread: http://forums.slimdevices.com/showthread.php?t=87845

_______________________________________________
ripping mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/ripping

Reply via email to