Color Swatch contact sheet from palette colors

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

garek007

Color Swatch contact sheet from palette colors

Post by garek007 »

X -

Sorry to bother you, yet again, but seeing as you've put all this work into helping me I want to be able to give a finished script back. For some reason I'm getting a log window but no CSV file. I used it yesterday and I swear it worked. It looks like it produces a logfile when there is no PS7, but I am using CS2.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

xbytor

Color Swatch contact sheet from palette colors

Post by xbytor »

The simple fix is to change the
Code: Select allif (isPS7()) {
at the bottom to
Code: Select allif (true) {
garek007

Color Swatch contact sheet from palette colors

Post by garek007 »

Okay now I get this:

Error 54: Uncaught JavaScript exception: Unable to open /c/workCSwatch.csv.. Line: 694
-> throw "Unable to open" + outfile + "," + outfile.error;

what in god's name am I doing wrong? I think I need to reformat this machine, it's not being cooperative.

when removing that line it says "Color books written to /c/work/CSwatch.csv" but there is nothing there.
xbytor

Color Swatch contact sheet from palette colors

Post by xbytor »

It's a bug/typo. File.open returns false if there was a problem and true if everything was ok. There was a missing '!'.

Code: Select all  if (true) {
    if (!outfile.open("w")) {
      throw "Unable to open " + outfile + ". " + outfile.error;
    }
    outfile.writeln(outstr);
    outfile.close();
    alert("ColorBooks written to " + outfile + ".");

  } else {
    var logwin = new LogWindow("ColorBook " + cb.title);
    logwin.append('\r\n' + outstr);
    logwin.show();
  }
garek007

Color Swatch contact sheet from palette colors

Post by garek007 »

Great, it's working now. Numbers seem off, but I'll work with it to see if I can fix it. I think I almost have the hang of it.