我正在努力構建顏色色板書。我首先從CMYK開始,一旦我首先確定這個格式,就會進入其他領域。我已經能夠開發所有需要的容器,但是我無法將fillColor添加到這些框中。我覺得我不知道該怎麼做。有人可以給我一些幫助嗎?以下是我的腳本。請記住,我的CMYK值必須能夠作爲變量ex輸入。將顏色構建添加到新的矩形,但在InDesign腳本中添加CMYK變量
瓦爾C = 0
瓦爾m = 0的
瓦爾y = 0的
瓦爾K = 0
當我通過一個循環運行此我會增加5%其所以,它會是c = c + 5,然後它會遍歷我的循環。
myDocument = app.activeDocument;
{//Create a layer to hold the printers marks (if it does not already exist).
var myLayer = myDocument.layers.item("ColorSwatches");
try{
myLayerName = myLayer.name;
}
catch (myError){
var myLayer = myDocument.layers.add({name:"ColorSwatches"});
}
}
//Create Rectangle
//Set the bounds of the rectangle [x1, y1, x2, y2]
//The x1, y1 refers to the upper left coordinate position; the x2, y2 refers to the lower right coordinate
//x2 = Height and y2 = Width
var myPage = myDocument.pages.item(0);
var y1=1.76
var y2=2.21
var x1=1.05
var x2=1.5
for (i = 0; i<105; i=i+5) {
for (m=0;m<105;m=m+5){
var myRectangle = myPage.rectangles.add({geometricBounds:[x1, y1, x2, y2]});
y1=y1+.50
y2=y2+.50
}
y1=1.76
y2=2.21
x1=x1+.50
x2=x2+.50
}
我只是想這行腳本,並進入調試模式和錯誤在這條線。我同意一個矩形具有這種顏色屬性,但我不認爲這是它的使用方式,從我所看到的你需要將它稱爲字符串 –
你是對的,它需要一個色板。看到我的其他答案 –