Skip to main content
c.pfaffenbichler
Community Expert
Community Expert
May 13, 2008
질문

beginners question: how to set a number of repeats for an operation

  • May 13, 2008
  • 2 답변들
  • 403 조회
Seems like a pretty basic feature, but I cant figure it out ...
I want Illustrator to create a certain number of random color-swatches but would like to avoid copy-pasting the relevant parts of the script that many times into the jsx-file.
How can I set such a number or get the script to go back to a certain line until the doc.swatches.length reaches the intended number?
Any help appreciated.
Illustrator 13.0.2 on Mac OSX 10.4.11
이 주제는 답변이 닫혔습니다.

2 답변

c.pfaffenbichler
Community Expert
Community Expert
May 13, 2008
Thanks for the prompt reply, great help.
JETalmage
Inspiring
May 13, 2008
Use a for loop:<br /><br />var numSwatches=prompt("How many Swatches do you want?", 12);<br /><br />for(i=0;i<numSwatches;i++){<br /><br />[do stuff];<br /><br />}<br /><br />JET