Skip to main content
Participant
October 22, 2010
Question

importAdobeSwatchbookSpotColor

  • October 22, 2010
  • 1 reply
  • 931 views

Hello everyone,
I have a problem with a script created in CS2.
The scripting creates
automatically a cover, assigning a pantone color to an element of the document.
While sripting work correctly cs2 does not work in CS4
the following error:

error code 24
string error: app.activeDocument.importAdobeSwatchbookSpotColor is not a function
Source: myColorDocument app.activeDocument.importAdobeSwatchbookSpotColor = ("PANTONE" myPantone + + "C");
interpreter: CS (2.0)

Where is the error?

Many thanks

This topic has been closed for replies.

1 reply

Jongware
Community Expert
Community Expert
October 22, 2010

This does work in CS4. (I'm assuming the bad syntax in your error message was not copied correctly from the error box ...)

myPantone = 504;
app.activeDocument.importAdobeSwatchbookSpotColor ("PANTONE "+myPantone + " C");

Note that this needs a space after "PANTONE" and before "C", to exactly match the name as it appears in the swatch library. But even if you forget those, you'd still get a simple "Swatch does not exist" message, rather than ".. is not a function".

You might want to check your entire script -- perhaps the actual cause of the error lies in a previous line.

Participant
October 22, 2010

the command syntax is correct, I put the spaces as indicated.
I note that the same script (with no change) works perfectly on cs2. This seems strange.

I have no idea what to change in the lines preceding the error.

if you want I can send you the complete script.

It refers to my pictures, but believe it is not a problem for you. Just change the name and place other images.

many thanks

Jongware
Community Expert
Community Expert
October 22, 2010

I'm sorry, I don't seem to get it.

myColorDocument app.activeDocument.importAdobeSwatchbookSpotColor = ("PANTONE" myPantone + + "C");

That's bad syntax. If it appears like that in the script, that's the cause of the error. I might add, not just for CS4 -- it's also bad syntax for CS2.

The adjusted script I posted works for CS4.