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

deleting text from text frame

Explorer ,
Apr 08, 2013 Apr 08, 2013

my question is does anyone now the best way or anyway to remove text from a text frame?

say if you want to remove anything in () in a text frame or any * symbols.

52(one on both sides) //you have this in a text frame

52 // and you want to change it to this by deleting (.)

or

40* //you have this in a text frame

40 // and you want to change it to this by deleting the *

any help would be great.

TOPICS
Scripting
4.0K
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

correct answers 1 Correct answer

Community Expert , Apr 09, 2013 Apr 09, 2013

this should do

myText2 = myText2.replace(/\((.+)\)/, '');

Translate
Adobe
Community Expert ,
Apr 08, 2013 Apr 08, 2013

Try this:

var aDoc = app.activeDocument;

var aTFrame = aDoc.textFrames;

var aString = "50*";

for (i=aTFrame.length-1; i>0; i--) {

    contentString = aTFrame.contents;

    if (contentString.indexOf(aString) != -1) { //if 50* present in the text frame

        //aTFrame.selected = true;

        //alert (contentString);

        aTFrame.contents = contentString.replace (/50\*/g, '50');

        }

    }

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