4 Replies Latest reply on Aug 28, 2013 11:30 AM by michael_mandahl

    Select specific text box to change text

    michael_mandahl Level 1

      I have a text box set up using a note value as "NAME". I would like to replace this with whatever the username is for that specific computer.  I tried to use the command, "USERNAME" but it actually places the text "USERNAME" in the text field. I would I pull the actual username from the computer environment?

       

      Also, I would like to repeat this code, should I just copy and paste the code below as many times as I want to change information?

       

      Hope that makes sense.

       

       

      var textFrames = activeDocument.textFrames;
      
            for (var i = 0 ; i < textFrames.length; i++)
              if (textFrames[i].note == "NAME") {
                var frameName = textFrames[i].contents = "USERNAME";
          }