Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Expert ,
May 12, 2008 May 12, 2008
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
TOPICS
Scripting
380
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
May 12, 2008 May 12, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 13, 2008 May 13, 2008
LATEST
Thanks for the prompt reply, great help.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines