Skip to main content
jeremy0013
Inspiring
October 23, 2015
Question

Select all same text

  • October 23, 2015
  • 3 replies
  • 3090 views

How would I go about selecting all the same text?  i.e. getByName("99999")? I am trying to select all text fields in a document and change them to a specific order number. Thanks for the help.

This topic has been closed for replies.

3 replies

jeremy0013
Inspiring
October 26, 2015

Thanks for all of your replies.  This is a pretty complex document as well I am very new to scripting illustrator.   I will have to do some more reading to figure out how to loop through everything and find all text frames. 

Qwertyfly___
Legend
October 27, 2015

A none scripting solution could be to have your main order number string.

add more fills using the Appearance panel and apply a transform effect to each fill to put it in the correct location.

then when you update the main order number string all others would update as well.

attached is an example.

right click and save as!

http://qwertyfly.com/files/order%20no%20example.pdf

jeremy0013
Inspiring
October 27, 2015

This is pretty interesting Q.  I haven't seen it done like this before.  Unfortunately there are 45 text boxes I need to change as well as javascript doing most of the work for this script anyway.  It's pretty complicated file.  What I am trying to accomplish is I have a layout for print.  There are 45 different pieces and 8 different sizes  The number is used on each piece as a label.  My script opens the art proof from my server takes all color information from the proof and transfers it to a print layout file, then renames the order number by var prompt "orderNumber", updates all linked files then runs applescript to play illustrator actions.  I am almost there but have a few missing pieces, one being replacing all order numbers and selecting linked files and updating the parent folder.  Again, I am REALLY new at this.  My guy that usually does this for me is busy on another project of mine and I have taken it in to my hands.  Any help would be appreciated.  And already is appreciated.   Thanks guys.

Silly-V
Legend
October 26, 2015

If it's always the same text fields and their contents change to show the same kind of information (e.g. the "order" textboxes are always used to contain order numbers), you can name or note, or tag or URL an identifier onto the desired text frames and use functions to loop through text frames in the entire document looking for this identifier. As well, you can simply put your special textframes into a single special layer (e.g. "Order Numbers") and have the script go through just that one layer, changing every single one of the text boxes.

CarlosCanto
Community Expert
Community Expert
October 24, 2015

since getByName always gets the first found element, you could save a reference to it, rename it and continue finding the next frames...rename back if necessary.

Disposition_Dev
Legend
October 26, 2015

I think carlos has the right answer. But i'll throw in my $.02 as well.

Depending on how complex the file is, you could also just loop a conditional statement that selects the textFrame if its name is "999999".