Change the Format of multiline text

My document contains 2 places that I want to change a particular number.

Capture.JPG

Here is the code that I currently have to change the number I want.

#target illustrator
var doc = app.activeDocument;
var allText = doc.textFrames;
for (var i = 0; i < allText.length; i++) {
  if (allText[i].contents.substring(0,11) == "UENR3640-05"){
  var mediaNumber = allText[i].contents.replace("UENR3640-05", "UENR3640-06");
  allText[i].contents = mediaNumber;
  }
  }

The yellow box is a multiline that contains 3 different font size. So when I run my script above changes the number in the thin gray box. However the yellow area it becomes...

Capture2.JPG

Any help that ignores the implementation text and just change the text that I installed? I would also like to be able to make it run on all open documents.

It is on a PC under Windows 7 64-bit with Adobe Illustrator CS4

Thanks in advance!

Make your highest code in a function that accepts an object of document as an argument and make inside a loop which goes through all the documents.

#target illustrator
function test(){
  function processDoc(doc){
    var s = /UENR3640-05/gi;
    var replacer = "UENR3640-06", result;
    var allText = doc.textFrames; 

    for (var i = 0; i < allText.length; i++) {
    while (result = s.exec(allText[i].contents)) {
          try {
                aCon = allText[i].characters[result.index];
                aCon.length = result[0].length;
                aCon.contents = replacer;
            } catch (e) {};
      }
    }
  };
  for(var i=0; i 
         

Tags: Illustrator

Similar Questions

  • Change the formatting of the text in the text edit box?

    Is there a way to change the formatting of text in a text box entry? I'm looking at the style settings, and I see no way to fit to the left of the text, change the color of the text and make the text smaller.

    Thank you.

    Check the option see the scrollbar in the accordion of Options, allowing to be wrapped over multiple lines of text.

    An alternative is the TextArea widget.

    Lilybiri

  • How to change the format of text ticker mode?

    Hi all

    How to change the format of text ticker mode?

    Thank you

    Hello

    If you want to format the ticker together with particular format then put in the start text
    before the tag Table
    put the fonts with necessary attributes tag

    In the end after the tag text table

    Close the tag are

    Thank you
    Vino

    Published by: Vinodh NK on March 18, 2010 04:36

    Published by: Vinodh NK on March 18, 2010 04:36

  • Is there a way to change the color of my text &amp; fonts?

    I would like to change the color of my text that I added my thoughts in a response message, how can I do this?

    Thank you!!

    Eric

    You must compose messages in HTML format in order to apply the colors, styles, and other formatting. The default format is defined under the tools/account settings /accountname/Composition & address.

  • How to change the default alignment of text in the cells in a table on the demand for numbers?

    I'm new to Mac. I own a MacBook pro MF839HN/A and currently using the 3.6.2 release NUMBERS (2577). I want to know if I can change the default alignment of text in the cell in a table of NUMBERS application? Also, when I select all the cells in a table to change their alignment, I can only change the horizontal alignment of the text and not the vertical alignment. To change the vertical alignment of the text in a cell, I have to select them individually. Help me with two questions.

    The only way I know is to create a table that is set up as you like, then save the empty document as a template customized by using the menu item "file > save as template:

  • M125a: I can't change the format of paper copy in HP M125a

    Hi all

    I bought a printer HP M125a (print, copy, scan), but I have a problem with the copy of Pages A4.

    When I put my A4 paper in the scanner to copy, laser scan only my printer from start position LTR (letter) is the result of 2CM at the bottom of my main A4 sheet not copied.

    Notice: When I analyze a picture to cumputer I don't have this problem and al of my scanned image, but a copy.

    I think I need to change the format of paper copy or print settings. I put all paper sizes in 'Control panel-> devices and printers' A4, but my problem not solved.

    Please help me solve... Please...

    Thank you all.

    Hello

    On the start menu, open the Printers folder and open the Toolbox of the HP device.

    In the 'System' tab select copy settings and change the format of A4 paper, then click on apply and confirm the changes.

    Shlomi

  • change the format of a string

    Hi all

    Now what I'll do is to convert a string to an array.

    The string I got is shown on the photo as an attachment with my code.

    Of course, the table is not correct.

    I wonder if there is a way to change the format of the string without empty lines and concatenate each number after another.

    in order to have a correct table with my code.

    Or someone has idea to a new code for the conversion of a string like this in the table?

    Thank you

    Chao

    I think they are referring to something like this.

  • How to change the report batch header text in the report dynamically?

    Hello, everyone. Now I use teststand to measure a voltage test point.there value are a PIN in the control circuit of this values.now I want to change the report batch header text in the example of report.for, I use only one step in a sequence file and can use an expression to change the PIN value.now I want to change the header text batch report through the movement of the expression.i is not found of teststand help document.how I do?

    Thank you ~.

    my email is [email protected].

    In addition, I'm sorry to tell you that my English is poor.if you have any questions, just tell me as soon as POSSIBLE.

    I'm looking forward to your reply ~ ~ ~

    Hi sar818,

    This article points to the name of the step, you can modify with the TestStand API:

    Step.Name = "newStepName".

    You can call it is the expression of position of the step:

    Note that this change will only continue during execution.

  • digitization of word document to change it without changing the format

    I use Microsoft document imaging to scan documents to word, but I think that OCR will change the format. Is there any solution for this?

    Ask in the forum Office:
    http://answers.Microsoft.com/en-us/Office

  • I use Windows Live Movie Maker and I am trying to download my video on Youtube. It does not accept the format in which the file is located. How can I change the format of the file?

    I'm not sure how to change the format, although he tells me to. Can anyone help?

    Hello

    As the issue is specifically related to Windows Live movie maker, I suggest you to refer to the link provided below for assistance.

    Movie Maker Portal

    http://windowslivehelp.com/product.aspx?ProductID=5

  • You cannot change the format of the cursor

    Original title: mouse cursor

    Cannot change the format of the cursor; message says no file found - for example, C:\WINDOWS\Cursors\arrow\_rl.cur

    _rl.cur is not a slider that comes with XP. Nor is the folder named arrow. You must have installed a 3rd slider party system and I guess you are trying to change that.
    Try to reinstall it.

  • How can I change the format of a film shot in Microsoft Movie Maker?

    Help! Windows Movie Maker: convert a file

    How can I change the format of a movie in movie maker from microsoft so that it can be universally accessed? or uploaded to youtube?

    I suspect you want to view/download the. Project MSWMM file
    which is only useful for re - edit in Movie Maker.

    Try to save your Movie Maker project in the. Film WMV format.
    With your project open in Movie Maker are... try the following steps...

    To save in a .wmv movie file...
    Type of... CTRL + P (or go to...) File / save movie file)
    to open the wizard movie recording.
    Choose... My computer.
    Next /.
    Enter a name and a location.
    Next /.
    ICT... "Best quality for my computer.
    Next /.
    Wait while the movie is saved.
    Finishing...

    The next YouTube document offers guidelines for downloading video:

    Quote: "not bigger than 2 GB and no more than 15 minutes in length"

    YouTube Help Center: for starters: how to download
    http://www.Google.com/support/YouTube/bin/answer.py?hl=en&answer=57924

  • WINDOWS MOVIE MAKER - HOW TO CHANGE THE FORMAT

    I did a movie in windows movie maker for a school project... but my school needs him in VLC or media player... How can I change the format?

    The film you made in windows movie maker, it can be played by VLC and Media Player, don't you worry :), continue your school project... Good luck with that :)

  • I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    I get videos from cell phones of the people with a type of file like 3GP. I need to know how to save and change the format so I can open them.

    Trying to convert to the. WMV format:

    There are many converters available on the net... some
    free... some detail.

    The following freeware converter is just one example:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory (freeware)
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster download)
    (the file you want to download is: > FFSetup295.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the final screens)
    (Windows XP / Vista / 7)

    First, you will need to decompress the file or just open the
    Drag > FFSetup295.exe< out="" of="" the="">
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • How can I change the format of my photos to upload on a social media program?

    I want to download my photos on a dating site. How can I change the format of my pictures to do?

    Hi Rose,

     
    1. in which file format you are trying to change the image?
    2. what file format you are trying to change?

    I suggest you to see link and check if it helps.
     
     
     
    I hope this helps.

Maybe you are looking for