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

Dialog box with multiline input?

Explorer ,
Nov 19, 2015 Nov 19, 2015

I am working on automating one of our more tedious graphic types, a typed up deposition, and ran into a snag. I have a dialog box pop up that the user populates. They put in the Deponent's name, position, and then I have a large area for them to paste in the text they would like to insert into the graphic. Unfortunately it only pastes the first line of the text. Is there a way to input more than one line into a dialog box? Initial searches lead me to believe that prompt inputs can only be one line, but I have to imagine there is a way. Any ideas? Not having any issues putting the text in the box, the issue is pasting into the dialog.

Thanks!

Here is a trimmed down version of the portion of the dialog I am having issues with:

The content GRP is the area I was planning to use for the multi-line text blocks.

// Export dialog

    this.dlg = new Window('dialog', 'Create new depo layer');

    // PANEL to hold options

    var msgPnl = this.dlg.add('panel', undefined, 'Create new deposition layer');

    // content GRP

    var contentGrp = msgPnl.add('group', undefined, '')

    contentGrp.oreintation = 'row';

    contentGrp.alignment = [ScriptUI.Alignment.LEFT, ScriptUI.Alignment.TOP]

   

    var contentSt = contentGrp.add('statictext', undefined, 'Content:');

    contentSt.size = [100,20]

    var contentEt = contentGrp.add('edittext', undefined, '');

    contentEt.size = [ 300,500 ];

   

    var btnPnl = this.dlg.add('group', undefined, '');

    btnPnl.orientation = 'row'

    btnPnl.cancelBtn = btnPnl.add('button', undefined, 'Cancel', {name:'cancel'});

    btnPnl.cancelBtn.onClick = function() {this.dlg.close() };

    // OK button

    btnPnl.okBtn = btnPnl.add('button', undefined, 'Create Single Depo Layer', {name:'ok'});

    btnPnl.okBtn.onClick = function() {

            //add the textPull content in

            var textPullBox = docRef.textFrames.getByName("textPull");

            if(contentEt.text != ''){

               textPullBox.contents = contentEt.text;

            }

            var paraStyle;

            if (contentEt.text.match(/Q./) || contentEt.text.match(/A./)){

                paraStyle = docRef.paragraphStyles.getByName("DepoPull");

                }

            else{

                paraStyle = docRef.paragraphStyles.getByName("TextPull");

                }

            //apply the paragraph style

            for(tp=0; tp<textPullBox.paragraphs.length-1; tp++) {

                paraStyle.applyTo(textPullBox.paragraphs[tp], true);

            }

           

            //close dialog box

            this.dlg.close();

    };   

    this.dlg.show();

TOPICS
Scripting
981
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

Mentor , Nov 19, 2015 Nov 19, 2015

// change to this:

var contentEt = contentGrp.add('edittext', undefined, '', {multiline: true, scrolling: true});

Hope it helps your efforts.

Translate
Adobe
Mentor ,
Nov 19, 2015 Nov 19, 2015

// change to this:

var contentEt = contentGrp.add('edittext', undefined, '', {multiline: true, scrolling: true});

Hope it helps your efforts.

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
Explorer ,
Nov 20, 2015 Nov 20, 2015
LATEST

Perfect! I knew there had to be a way. Thanks!!

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