I no you can’t alias Process colours to spot, only spot to process and spot to spot
unless you have pit stop or other high end software.
Under the ink manager I can alias C=0 M=0 Y=0 K=100 to Black with no issues at all
yet when I try to script it I run into issues.
The below code works fine if I alias C=0 M=0 Y=0 K=100 to UNPRINTED, or any other spot for the matter
yet it won’t alias to Black, I have as you can see tried different things, all fail.
the error I get is:
“Can’t make «class cink» “Black” of document id 38 of application “Adobe InDesign CC 2015” into type string”
not sure what I am missing to make this work, can some body enlighten me please?
tell application "Adobe InDesign CC 2015"
set myDocument to active document
tell myDocument
--if exists name of swatch "C=0 M=0 Y=0 K=100" as string then
--set _CMYK_Black to ink "C=0 M=0 Y=0 K=100" --as string
if exists "C=0 M=0 Y=0 K=100" then
set _CMYK_Black to "C=0 M=0 Y=0 K=100" as string
set alias ink name of ink _CMYK_Black to ink "Black" as string -- DOESNT WORK
--set alias ink name of ink _CMYK_Black to ink "[Black]" as string -- DOESNT WORK
--set alias ink name of ink _CMYK_Black to ink "Process Black" as string -- DOESNT WORK
--set alias ink name of ink _CMYK_Black to "UNPRINTED" as string -- WORKS ink is made up from C20 M5 Y60 K0
end if
end tell
end tell
I’m not sure what you’re trying to do, but alias ink name wants a simple string, like “Black” – you’re trying to coerce an ink to a string, which is what the error is telling you.
Quite often we get client pdf’s sent to us with a spot colour
made up from CMYK channels called C=0 M=0 Y=0 K=100 which has been
named with the color value.
In the document they use this colour as well as the process “Black”
colour, basically they end up using two blacks C=0 M=0 Y=0 K=100 & Black
and we end up having to under ink manager create and ink alias of
C=0 M=0 Y=0 K=100 to “Process Black”.
All I am trying to do, is do want ink manager does, but script it.
I second Shane. Your third unworkable instance is workable without the second ink. Additionally, consider that if exists “Santa Claus” would be equally as true as if exists “C=0 M=0 Y=0 K=100”; you are testing a string, rather than the ink class.
tell application "Adobe InDesign CC 2015"
set myDocument to active document
tell myDocument
if exists ink "C=0 M=0 Y=0 K=100" then
set _CMYK_Black to "C=0 M=0 Y=0 K=100" as string
set alias ink name of ink _CMYK_Black to "Process Black"
end if
end tell
end tell
FWIW, that as string is unnecessary there. It won’t hurt, but it just makes your code look more complex than it needs to. In fact, if you only use the _CMYK_Black variable here, the whole line is unnecessary – just use:
set alias ink name of ink "C=0 M=0 Y=0 K=100" to "Process Black"