4 Replies Latest reply on Mar 3, 2008 11:54 AM by Bob, Adobe Engineer

    How to get value from textfield.

      I created a edittext field using scriptUI and i want to get the data from that textfield.
      I use variable editcontets to get the data but in this case it not working. I am posting my script. Please let me know if there is any thing wrong i am doing.

      var g3 = myDlg.msgPnl1.add( "group" );
      myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, 'Name: ');
      myDlg.msgPnl1.titleEt = g3.add('edittext', undefined,'Test');
      var amit = myDlg.msgPnl1.titleEt.editContents;
      myDlg.msgPnl1.create = g3.add('button', undefined, 'Create');
      myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, ' ');

      when you run the script whatevery data in that text field will come o the variable amit.
      When i am trying to run this script i am getting alert as "undefined".
      I do not why please help me in this matter as well.

      Thank you,
        • 1. Re: How to get value from textfield.
          Level 1
          Where the heck did you come up with "editContents"?

          As in:

          var amit = myDlg.msgPnl1.titleEt.editContents;

          "editContents" is not, and never has been a part of the object model for scriptUI. Are you using the docs, theOMV, or are you just guessing at what the properties might be?

          To get the contents of a scriptUI edittext box:

          var amit = myDlg.msgPnl1.titleEt.text;

          PLEASE - use either the docs or the OMV to at least try to come up with an answer on your own. None of us here mind helping. Please respect us and our experience by at least attempting to figure it out on your own.

          A question like this tells me that you haven't tried using the OMV for scriptUI.

          Believe it or not, all of us learned how to do this the hard way. We fought through PDF documents for hours on end trying to figure out how to make things work. We don't mind showing people the way. We do object to writing a script for someone, one problem at a time.


          • 2. Re: How to get value from textfield.
            Level 1
            Sorry Bob,

            I respect you and your experience. I am giving an assurances that i will never come up with such easy stuff. I will try by my self first and if it is impossible to make it out. I will come up on forum.

            Can you give me any link where i can get how to use OMV and some good sample script. By using this tool i can solve my problem.

            thank you,
            • 3. Re: How to get value from textfield.
              Level 1
              In the ESTK, look under the "Help" menu.

              You will see menus:

              Core JavaScript Classes
              ScriptUI Classes
              Adobe Bridge CS3 Object Model
              Adobe Illustrator CS3 Type Library
              Adobe InDesign CS3 Object Model
              Adobe Photoshop CS3 Object Library
              ExtendScript ToolKit ReadMe
              SDK -> Adobe Intro to Scripting
              JavaScript Tools Guide CS3

              The top 6 menu items open the OMV with the corresponding object model. The SDK menu gives access to a couple of handy pdf's.

              • 4. Re: How to get value from textfield.
                Harbs. Level 6
                Bob Stucky wrote:
                > Where the heck did you come up with "editContents"?
                "editContents" would have been correct if he were using regular (non
                script UI) dialogs...