Pages: [1]   Go Down

Author Topic: Shell Script to rename Mac ICC profiles to match file name  (Read 669 times)

EvanRobinson

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
Shell Script to rename Mac ICC profiles to match file name
« on: July 21, 2017, 05:12:13 pm »

I am still in the evaluating papers phase of printing on my Canon PRO-1000, and I bought a bunch of Hahnemuhle and Ilford sample sets.

So I downloaded profiles.

I HATE the way paper manufacturers name profiles.  The filenames are fine, but in menus I want to be able to identify:
  1) the manufacturer
  2) the paper name
  3) the correct black channel (Matte or Photo)

WAY down on the list is the printer type.  Both Hahnemuhle and Ilford put the printer right near the front of the filename, so I am constantly going past CanPro1000 or something similar.

So I used Better Finder Rename to rename all the profiles, and I wrote a script to use sips to rename each profile to its base filename.

Here it is.  You may have to change it for your purposes:
----start code----
#!/bin/bash

for file in ./H*
do
  BASENAME="sips -s description '$(basename -s .icc $file)' '$file' "
  echo 'executing $BASENAME...'
  eval $BASENAME
done
----end code----

It's sloppy and badly named and all that shit, but it worked for me, and only took about as long as it would have taken me to rename half of those profiles.

Hope someone finds it useful.
Logged
Pages: [1]   Go Up