EDITTEXT field

Is it possible to disable the textediting

for a field of textedit? I need to show

large amounts of text in the Panel.

I think the only way is to use a text-

change the field. But the mounting must be disabled.

Cannot find this in the forums.

Best regards Michel

scriptworx

Use a StaticText object with scrolling set to true:

var win = new Window ("dialog");

txt var = win.add ("statictext", undefined, "bfhhfhdfihafihfdaj hiahfiahfidsflabla", {scroll: true});

Win.Show ();

Tags: InDesign

Similar Questions

  • Access of the edittext field name

    I created an edittext field and gave him the name "myText". That's what I tried.

    Window.Edit = Window.add('edittext', undefined,undefined, {name:"myText"});
    Window.Edit = func;
    
    function func()
    {
         alert(this.name);
    }
    
    

    However, I only get "undefined" as a result.

    How can I fix?

    I created an edittext field and gave him the name "myText". That's what I tried.

    Window.Edit = Window.add('edittext', undefined,undefined, {name:"myText"});
    Window.Edit = func;
    
    function func()
    {
         alert(this.name);
    }
    
    
    

    However, I only get "undefined" as a result.

    How can I fix?

    In fact, there are two problems in your code:

    First, restore you Window.Edit func, so Window.Edit is no longer being EditText do you think it is.

    Secundus, name is not a property of the construction EditText, so it is ignored at the time of construction of widget.

    However, you can add a building after the property name :

    var w = new Window('dialog', 'title');
    w.edit = w.add('edittext');
    
    w.edit.name = "myText";
    
    // useless, but it works:
    w.edit.getName = function(){alert(this.name);}
    
    // etc.
    

    @+

    Marc

  • Creating layers of the multiline edittext fields multiline text questions

    Hi all

    I wrote a script that accepts a user input and puts in the part layerName.textItem.contents to a text layer, code example below.

    var docRef = app.activeDocument;
    var win = new Window("dialog", "Hello world");
    var input = win.add("edittext", [0,0,400,40], "", {multiline:true, wantReturn:true});
    input.active = true;
    var go = win.add("button", undefined, "Go");
    
    function makeText() {
         var myText = docRef.artLayers.add();
         myText.kind = LayerKind.TEXT;
         var ref = myText.textItem;
         ref.kind = TextType.POINTTEXT;
         ref.size = 50;
         ref.contents = input.text.replace(/\\n/g,'\r');
         win.close();
    }
    go.onClick = function() {
        docRef.suspendHistory("text", "makeText()");
    }
    
    win.show();
    

    However, simply using entry for a new line in the input box produces unexpected results:

    Screen Shot 2016-09-04 at 01.42.38.png

    Curiously, the symbol of the copy and paste elsewhere show that it is a new line character, it is simply not recognized by Photoshop.

    By setting wantReturn to false and adding a keypress eventListener:

    win.addEventListener("keydown", function(kd) {pressed(kd)});
    function pressed(k) {
        if (k.keyName == "Enter") {
            input.text += "\\n";
        }
    }
    

    I am able to get a new line correct, although each press of Enter brings the cursor at the beginning entry field, forcing the user to manually move the cursor at the end before you can continue typing. This too (of course, I guess) puts a visible "\n" in the input field.

    Is there a solution that, at least, can prevent the cursor jumps at the beginning whenever you press Enter? Ideally the end user would not see "\n" in the input field at all, but rather a new visible line in the input field which translates a new visible line in the text layer.

    I'm under CS6 on OSX but will mainly use the script from Windows, also CS6.

    Thanks to all who can help.

    Change line 13 for your regex to:

    REF.contents = input.text.replace(/\n/g,'\r');

  • [ScriptUI] edittext fiddle (show/hide and game)

    See you soon,.

    I'm writing a small script that does some stuff find/replace. My idea is to any error information to an edittext field nested inside an exit sign and display only this textfield if my grep function fails. I read Peer Kahrels ScriptUI Basics (thanks for this reference ), but I still don't know how to upgrade the textfield outside my creation-palette-function.

    Can you help a beginner without hope?

    showPalette();
    
    function showPalette() {
        var j_logo = new File("~/Desktop/Jysk_GREP/jysk_logo.png");
        var e_logo = new File("~/Desktop/Jysk_GREP/env_logo.png");
        var myDialog = new Window('palette', 'Jysk Search-Replace');
        var myIconGroup1 = myDialog.add('group', undefined, '');
            myIconGroup1.add('image', undefined, j_logo);
        var myGroup = myDialog.add('group', undefined, '');
        myGroup.orientation = 'row';
            var myPanel1 = myGroup.add('panel', undefined, 'Berthold');
                myPanel1.margins = [15,20,15,15];
                var bDK = myPanel1.add('button', undefined, 'DK', {name:'DK'});
                var bSE = myPanel1.add('button', undefined, 'SE', {name:'SE'});
            var myPanel2 = myGroup.add('panel', undefined, 'Compacta');
                myPanel2.margins = [15,20,15,15];        
                var cDK = myPanel2.add('button', undefined, 'DK', {name:'DK'});
                var cSE = myPanel2.add('button', undefined, 'SE', {name:'SE'});    
        var myGroup2 = myDialog.add('group', undefined);
                var myAlertPanel = myGroup2.add('panel', undefined);
                var list = myAlertPanel.add('edittext', undefined, ["test","test"].toString(), {multiline: true, scrolling: true});
                list.maximumSize.height = myDialog.maximumSize.height-100;
                list.maximumSize.width = 204;
        myDialog.show();    
    }
    

    Best wishes

    Rasmus

    Oh, like this. The section "Communication between windows" (in the ScriptUI guide) explains how you could do it, but doesn't something clear, so here is a summary.

    First of all, you need a window as a palette. And you need to the name of your edittext control:

    . . .

    var myText = w.add ("edittext", [0, 0, 150, 70], "", {multiline: true, name: 'runGrepErrors'});

    . . .

    Now you can access this control with any other script:

    function runGrep (params) {}

    try {}

    do things change in text

    } catch (e) {}

    var w = Window.find ("palette", "Multiline");

    If (w! == null) {}

    If (! w.visible) w.show ();

    w.findElement ("runGrepErrors") .text = e.message;

    }

    }

    }

    Preview: allows you to get a reference to your palette Window.find () . Make sure the palette is visible, then use findElement() get a reference to the palette edittext control.

    Peter

  • Android ClipboardManager question

    Hello

    I am facing a problem with the ClipboardManager of our Android app scope. We use the Clipboard to copy text and select Paste in text edit fields.

    Situation: Place the text into the pit of the Manager "ClipboardManager.setPrimaryClip (...)" or "ClipboardManager.setText (...)", translated by empty Clipboard Manager:

    'ClipboardManager.getPrimaryClip ()' and 'ClipboardManager.getText ()' return the NULL value

    "ClipboardManager.hasPrimaryClip ()" and "ClipboardManager.hasText ()" return FALSE

    The only way to get the ClipboardManager filled with data, is a native application, text selection, copying. Then and then only, we have the ability to 'Paste' in our EditText fields, and the date is properly glued in the field.
    Unfortunately, if we have the Clipboard filled (from a native application) and we use some of the methods 'set' of the ClipboardManager, bring back us to nulls contained - the result is a cleared Clipboard Manager and empty.

    Thoughts, ideas or workarounds are welcome.

    If you encounter the same problem, I introduced a bug for BB currently, and you can follow here: BBTEN-3056

    Thanks in advance

    EDIT: Essays on BB Z10 10.3.0.442 (downloading 10.3.1 to update and verify with)

    Just an update:

    We have updated our device test to 10.3.1.634, and the good news is that this problem is SOLVED, as well as other issues, I presented previously.

  • ScriptUI repeating section does not work

    I'm pretty well versed in Javascript and ExtendScript now, including ScriptUI. However, there is something that escapes me, and it's when there is a repeating section in a ScriptUI dialog box and how to manage dynamic controls. Stand-alone example which should work very well in the ExtendScript Toolkit for InDesign CC 2015:

    /**
     * Label is an object that represents a single label for a product.
     * 
     */
    function Label(lSize, lQuantity, lInstructions, lContentType, lContents) {
        this.lSize = lSize; // String: The size of the label ("Brother 3x1", "Zebra 3x1", or "Zebra 6x4").
        this.lQuantity = lQuantity; // Number: Actual quantity of this label.
        this.lInstructions = lInstructions; // String: The instructions for this label.
        this.lContentType = lContentType; // String: "Text" = text-only label, "File" = file-based label (using pre-made artwork).
        this.lContents = lContents; // String or File: Depending on previous property, can be a String for a text-only label,
            // or a File object for a file-based label.
    }
    
    
    
    
    
    
    // Label groups, as an object.
    function labelGroup (labelPanel, quantityInstGroup, quantityInstStatics, quantityInstFields, quantity,
            instructions, labelSizeGroup,
            rbBrother3x1, rbZebra3x1, rbZebra6x4,
            labelTypeGroup, labelTypeRadios, labelTypeFields,
            typeFileGroup, rbTypeText, rbTypeFile,
            textfield, filenameField, browsebutton, fileselected) {
        this.labelPanel = labelPanel;
        this.quantityInstGroup = quantityInstGroup;
        this.quantityInstStatics = quantityInstStatics;
        this.quantityInstFields = quantityInstFields;
        this.quantity = quantity;
        this.instructions = instructions;
        this.labelSizeGroup = labelSizeGroup;
        this.rbBrother3x1 = rbBrother3x1;
        this.rbZebra3x1 = rbZebra3x1;
        this.rbZebra6x4 = rbZebra6x4;
        this.labelTypeGroup = labelTypeGroup;
        this.labelTypeRadios = labelTypeRadios;
        this.labelTypeFields = labelTypeFields;
        this.typeFileGroup = typeFileGroup;
        this.rbTypeText = rbTypeText;
        this.rbTypeFile = rbTypeFile;
        this.textfield = textfield;
        this.filenameField = filenameField;
        this.browsebutton = browsebutton;
        this.fileselected = fileselected;
    }
    
    
    
    
    // Label dialog.
    function getLabelInfo (labelArray, lastButton) {
        var totalNumLabels = 3;
        var wLabelTitle = "Label";
        wLabelTitle += totalNumLabels > 1 ? "s " : " ";
        wLabelTitle += "for item: " + "<Test Name>" + ".";
        var lastButtonText = lastButton ? "Begin Proofing" : "Next Product";
    
    
    
    
        var wLabel = new Window("dialog", wLabelTitle);
            var productNameText = wLabel.add("statictext", undefined, "<Test Name>");
                // productNameText.graphics.font = ScriptUI.newFont("Myriad Pro", "Bold", 20); // Font handling no longer works in CC+.
    
    
            var labelGroups = [];
            for (var index = 0; index < totalNumLabels; index++) {
                // For each label for this item, create a labelGroup object and add it to the array.
                var thisGroup = new labelGroup();
                thisGroup.labelPanel = wLabel.add("panel", /*[0, 0, 300, 75]*/ undefined, "Label " + (index + 1));
                thisGroup.labelPanel.orientation = "row";
                    thisGroup.quantityInstGroup = thisGroup.labelPanel.add("group");
                    thisGroup.quantityInstGroup.alignChildren = "top";
                        thisGroup.quantityInstStatics = thisGroup.quantityInstGroup.add("group");
                        thisGroup.quantityInstStatics.orientation = "column";
                        thisGroup.quantityInstStatics.alignChildren = "right";
                        // thisGroup.margins = [0, 3, 0, 0]; // [left, top, right, bottom].
                        thisGroup.quantityInstStatics.margins.top = 3;
                        thisGroup.quantityInstStatics.spacing = 15;
                        thisGroup.quantityInstStatics.add("statictext", undefined, "Quantity: ");
                        thisGroup.quantityInstStatics.add("statictext", undefined, "Instructions: ");
                    thisGroup.quantityInstFields = thisGroup.quantityInstGroup.add("group");
                    thisGroup.quantityInstFields.orientation = "column";
                    thisGroup.quantityInstFields.alignChildren = "left";
                        thisGroup.quantity = thisGroup.quantityInstFields.add("edittext");
                        thisGroup.quantity.characters = 6;
                        thisGroup.instructions = thisGroup.quantityInstFields.add("edittext", [0, 0, 200, 55], "",
                            {multiline: true, scrolling: true, wantReturn: true});
                thisGroup.labelPanel.add("panel", [0, 0, 2, 100]); // Vertical divider line.
                thisGroup.labelSizeGroup = thisGroup.labelPanel.add("group");
                thisGroup.labelSizeGroup.orientation = "column";
                thisGroup.labelSizeGroup.alignChildren = "left";
                    thisGroup.rbBrother3x1 = thisGroup.labelSizeGroup.add("radiobutton", undefined, "Brother 3x1");
                    thisGroup.rbZebra3x1 = thisGroup.labelSizeGroup.add("radiobutton", undefined, "Zebra 3x1");
                    thisGroup.rbZebra6x4 = thisGroup.labelSizeGroup.add("radiobutton", undefined, "Zebra 6x4");
                    thisGroup.rbBrother3x1.value = true;
                thisGroup.labelPanel.add("panel", [0, 0, 2, 100]); // Vertical divider line.
                thisGroup.labelTypeGroup = thisGroup.labelPanel.add("group");
                thisGroup.labelTypeGroup.alignChildren = "top";
                    thisGroup.labelTypeRadios = thisGroup.labelTypeGroup.add("group");
                    thisGroup.labelTypeRadios.orientation = "column";
                    thisGroup.labelTypeRadios.alignChildren = "left";
                    thisGroup.labelTypeRadios.margins.top = 6;
                    thisGroup.labelTypeRadios.spacing = 13;
                        thisGroup.rbTypeFile = thisGroup.labelTypeRadios.add("radiobutton", undefined, "File");
                        thisGroup.rbTypeText = thisGroup.labelTypeRadios.add("radiobutton", undefined, "Text");
                        thisGroup.rbTypeText.value = true;
                    thisGroup.labelTypeFields = thisGroup.labelTypeGroup.add("group");
                    thisGroup.labelTypeFields.orientation = "column";
                    thisGroup.labelTypeFields.alignChildren = "left";
                        thisGroup.typeFileGroup = thisGroup.labelTypeFields.add("group");
                            thisGroup.filenameField = thisGroup.typeFileGroup.add("edittext", undefined, "---", {readonly: true});
                            thisGroup.filenameField.characters = 20;
                            thisGroup.browsebutton = thisGroup.typeFileGroup.add("button", undefined, "Browse");
                            thisGroup.browsebutton.onClick = function () {
                                thisGroup.fileselected = File.openDialog();
                                thisGroup.filenameField.text = thisGroup.fileselected.name;
                            };
                        thisGroup.textfield = thisGroup.labelTypeFields.add("edittext", [0, 0, 200, 55], "",
                                {multiline: true, scrolling: true, wantReturn: true});
    
    
                labelGroups.push(thisGroup);
            }
    
    
            var buttonGroup = wLabel.add("group");
                buttonGroup.alignment = "right";
                var cancelButton = buttonGroup.add("button", undefined, "Cancel");
                var okButton = buttonGroup.add("button", undefined, lastButtonText);
    
    
    
    
        function getLabelSize (rButtonGroup) {
            for (k = 0; k < rButtonGroup.children.length; k++) {
                if (rButtonGroup.children[k].value === true) {
                    return rButtonGroup.children[k].text;
                }
            }
        }
    
    
        function getContents (currentGroup) {
            if (currentGroup.rbTypeText.value) {
                return currentGroup.textfield.text;
            }
            return currentGroup.fileselected;
        }
    
    
    
    
        if (wLabel.show() == 1) {
            // Assign data gathered from fields to product's object.
            var thisLabel;
            for (j = 0; j < labelGroups.length; j++) {
                thisLabel = new Label(
                    getLabelSize(labelGroups[j].labelSizeGroup),
                    parseInt(labelGroups[j].quantity.text.replaceAll(/\,/g, ''), 10),
                    labelGroups[j].instructions.text,
                    labelGroups[j].textradiobutton.value ? "Text" : "File",
                    getContents(labelGroups[j])
                    );
                labelArray.push(thisLabel);
            }
        } else {
            $.writeln("[getLabelInfo] Canceling the Label window.");
            return 7;
        }
    
    
        return 0;
    }
    
    
    
    
    
    
    var returnedValue = 0;
    var labelArray = [];
    returnedValue = getLabelInfo(labelArray, true);
    

    This one has the repeating section appear 3 times, but in my main program, it can appear once or even 10 times. I do not know beforehand, but I need information to be stored with each section. The problem lies in the selection of a file for an article using the button "Browse". I would like to file name in edittext field in the same section next to the button, but which does not occur. What can I make sure that * fact * happen?

    I had the same issue... and all by responding to this post, I thought of an idea and tested... My idea has worked so I'll share =)

    Set the variable edittext field and push the name of the variable in a table. You may need to do the same thing with the buttons and navigation of each button array element value in the corresponding element of the array text edit... I just did a simple test, as evidenced by this script:

    var alledits = [];

    with (a new window ("dialog", "Test Editboxes Multiple")) {}

    for (c = 0; c<>

    var = Edit Add ("' edittext ', undefined,"change the text box"+ String (c + 1))

    alledits.push (Edit);

    } add ('button', undefined, "OK")

    Add ('button', undefined, "Cancel")

    {if (Show ()! = 1)}

    Exit()

    } else {}

    Alert(alledits[0].) (Text)

    }

    }

  • type in the list of columns SCRIPTUI

    Hi guys,.

    I have a terminology database that I created and I would like to add a feature that allows users to type in the edittext field to search for items in col1.

    Here is my code for the columns and the edittext field:

    var column = w.add('group{multiselect:true}');
    Columns.Spacing = 0;

    CGEM var = [0,0,200,600];

    var col1 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Trans-tibiale", "Trans-fémorale"]);
    var col2 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Party", "Transfémoral"]);        French
    var col3 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Trans-tibiale", "Trans-fémorale"]);      German
    var col4 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Transtibial", "Transfemorale"]);     Italian
    var col5 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Party", "Security"]);        Spanish
    var col6 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Trans-tibiale", "Trans-fémorale"]);      Norwegian
    col7 var = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Trans-tibiale", "Trans-fémorale"]);      Russian
    var col8 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "Trans-tibiale", "Trans-fémorale"]);      Turkish


    col1. Selection = 0;

    {col1. OnDoubleClick = Function ()}
    entry. Text = col1. Selection;
    };
    {col2. OnDoubleClick = Function ()}
    entry. Text = col2. Selection;
    };
    {Col3.OnDoubleClick = Function ()}
    entry. Text = Col3.Selection;
    };
    {Col4.OnDoubleClick = Function ()}
    entry. Text = Col4.Selection;
    };
    {col5. OnDoubleClick = Function ()}
    entry. Text = col5. Selection;
    };
    {col6. OnDoubleClick = Function ()}
    entry. Text = col6. Selection;
    };
    {col7. OnDoubleClick = Function ()}
    entry. Text = col7. Selection;
    };
    {COL8. OnDoubleClick = Function ()}
    entry. Text = COL8. Selection;
    };

    var user_input = w.add ('group')
    entry var = user_input.add ("'edittext', dimH, ' click on the button to the right to convert lowercase");
    entry. Characters = 30;
    entry. Alignment = 'left';
    entry.active = true;


    converting the vars = user_input.add ('button', undefined, "Convert to lowercase");
    convert.onClick = function () {entry.text = entry.text.toLowerCase () ;}
    user_input.orientation = 'row';
    user_input. Alignment = 'left';

    Everyone here is so helpful.

    Thank you

    Jake

    There are some examples of upcoming type here:

    https://INDD.Adobe.com/view/a0207571-ff5b-4bbf-A540-07079bd21d75

    Moreover, the group object is the multiselect property.

    Peter

  • Copy the InDesign UI of Script text into the list item

    Hello world

    I wrote a script code user interface to create a terminology database.

    I want to be able to click on an item in the list of all the columns and copy the text in edittext field.

    I don't know if I need to create a button for this or is - it possible to do a right-click of the mouse to copy text?

    Here is the code:

    var w = new window (' dialog {text: 'Blatchford termbase', alignChildren: 'fill'} "");
    w.Spacing = 0;

    var headers = w.add ('group');
    headers. Spacing = 0;
    headers. Margins = [0,5,0,0];
    dimH var = [0,0,200,20];

    headers. Add ("statictext', dimH, '\u00A0English'");
    headers. Add ("statictext', dimH, '\u00A0French'");
    headers. Add ("statictext', dimH, '\u00A0German'");
    headers. Add ("statictext', dimH, '\u00A0Italien'");
    headers. Add ("statictext', dimH, '\u00A0Spanish'");
    headers. Add ("statictext', dimH, '\u00A0Norwegian'");
    headers. Add ("statictext', dimH, '\u00A0Russian'");
    headers. Add ("statictext', dimH, '\u00A0Turkish'");

    headers.graphics.backgroundColor = w.graphics.newBrush (w.graphics.BrushType.SOLID_COLOR, [0.7,0.7,0.7],1);

    for (var i = 0; i < headers.children.length; i ++)

    headers. Children [i]. Graphics.font = scriptui.newFont ('Myriad Pro', 'fat', 16)

    var column = w.add('group{multiselect:true}');
    Columns.Spacing = 0;

    CGEM var = [0,0,200,600];

    var col1 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col2 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col3 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col4 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col5 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col6 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    col7 var = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);
    var col8 = columns.add ("listbox", CGEM, ["Dorsiflexion", "Field", "trans-tibiale", "trans-fémorale"]);

    var user_input = w.add ('group')
    entry var = user_input.add ('edittext', dimH, ");
    entry. Characters = 30;
    entry. Alignment = 'left';
    entry.active = true;

    col1. Selection = 0;

    converting the vars = user_input.add ('button', undefined, "Convert to lowercase");
    convert.onClick = function () {entry.text = entry.text.toLowerCase () ;}
    user_input.orientation = 'row';
    user_input. Alignment = 'left';

    w.Show ();

    Any help or comments would be greatly appreciated

    Try this

    col1.onChange =
     col2.onChange =
     col3.onChange =
     col4.onChange =
     col5.onChange =
     col6.onChange =
     col7.onChange =
     col8.onChange =
     function() {
      entry.text = this.selection? this.selection.text : "";
      }
    

    Loïc

    Ozalto | Productivity-oriented - Loïc Aigon

  • Shoot/Get/the data value of the window for user input

    I'm trying to do something that should be simple enough for a programmer, but unfortunately, unfortunately to be a designer, I'm having a devil of a time with it.  After spending hours searching and trying different things, I thought to post the problem.  I have the feeling that I'm not the first creator of evil with it.

    I'm trying to extract a window input data and to transmit it to a variable.  In the script, I do a few purge(), and I don't know if that clears the values of input from the user during the script, but it's thinking ahead...

    I need the values to:

    Layer.translate (X, Y) / / if I'm wrong, it must be not - string

    bitsaveoptions. Method = ChanelScreen; in menu drop-down

    bitsaveoptions.angle = KAngle / / if I am mistaken, this must not be one - integer

    bitsaveoptions. Frequency = ChanelFrequency; If I am mistaken, this must not be one - integer

    bitsaveoptions. Resolution = ChanelResolution; If I am mistaken, this must not be one - integer

    bitsaveoptions. Shape = BitmapHalfToneType.ROUND; in menu drop-down

    I know that there are different ways to retrieve data from a window how .value, and perhaps others, but I can't seem to extract the data from user input

    Any advice would be greatly appreciated.

    Thank you.

    PS I work with Photoshop CS5

    That's what I have so far.

    = Ruler with millimeters

    app.preferences.rulerUnits = Units.MM;

    var doc = app.activeDocument;

    var layer = doc.activeLayer;

    var dropdownlistArray = new Array(); / / the table of drop-down lists.

    var chosen_action = null;

    var ScreenShapeArray = new Array)

    "Round."

    "Elliptical".

    );

    var WinContent =

    "dialog box {------}.

    orientation: 'column ', \

    alignChildren: ['fill', 'top'],

    preferredSize: 300 (130) and \.

    text: "Export settings"------

    margins: 15,.

    \

    Coordinates: Panel {------}

    orientation: 'column ', \

    text: "Quarters of channels,"------

    margins: 15,.

    alignChildren: 'right ', \

    KChanelX: Group {------}

    St: StaticText {text: 'X:'}, \

    you: EditText {text: '15', characters: 4, justify: 'just'} \

    ST2: StaticText {text: 'mm'}, \

    } \

    KChanelY: Group {------}

    St: StaticText {text: 'Y'}, \

    you: EditText {text: ' 10', characters: 4, justify: 'just'} \

    ST2: StaticText {text: 'mm'}, \

    }\

    }\

    bottomGroup: Group {------}

    cancelButton: button {text: 'Cancel', properties: {name: 'Cancel'}, size: [120,24], alignment: ['right', 'Center']},

    applyButton: button {text: 'Apply', properties: {name: 'ok'}, size: [120,24], alignment: ['right', 'Center']},

    }\

    }"

    = Create object window

    var win = new Window (WinContent);

    = Display window

    Win.Show ();

    var X = parseInt (win. Coordinates.KChanelX.te.selection);

    var Y = parseInt (win. Coordinates.KChanelY.te.selection);

    alert (X); Here I get NaN

    alert (Y); Here I get NaN

    If (typeof (X) = 'undefined' | typeof (Y) = "undefined") {}

    Layer.translate (X + "mm", "-" + Y + "mm");

    } else {}

    Alert ("here"); Always end - up here regardles of canling or accept the default values

    };

    You don't have a selection in an edittext field. Like c.pfaffenbichler said - you get your X and your Y's

    var X = win.Coordinates.KChanelX.te.text;
    

    and so on:

    var X = parseInt(win.Coordinates.KChanelX.te.text); // or
    var X = Number(win.Coordinates.KChanelX.te.text);
    

    Have fun

  • Fill in textedit with selection field drop-down list

    Hello, everyone!

    Thank you much for the help that you give me for a long time.

    I have never seek and find great solutions.

    But this time, I have found nothing.

    I need to fill a field of textedit from a selection in a drop-down list.

    Is there a way to do this?

    My fragment:

    var myP0a = myGtop.add("panel", undefined, "JOURNAL");
    myP0a.margins = [10,15,10,10];
    var myTEMPLATE = myP0a.add("dropdownlist", ["","",200,25], ["", "Journal 01", "Journal 02", "Journal 03", "Journal 04", "Journal 05", "Journal 06"]);
    myTEMPLATE.selection = 0;
    
    var myGdoi = myG1.add("group");
    myGdoi.add("statictext", undefined, "DOI:");
    myGdoi.orientation = "row";
    var myDOI = myGdoi.add("edittext", undefined, "000");
    myDOI.characters = 34;
    

    Based on the selection of myTEMPLATE, I want to fill in the myDOI field.

    Is this possible?

    Thanks in advance and sorry if this question is already answered in another topic.

    The selection of a drop-down list is a ListItem object (or null), therefore, you just collect the selection.text from the drop-down list in the onChange of the drop-down list manager:

    myTEMPLATE.onChange = function(){
        if (this.selection===null || this.selection.text.length===0){
            myDOI.text = "000";
            }
        else{
            myDOI.text = this.selection.text;
            };
        // and maybe more stuff here
        };
    

    or equivalently, in a shorter form:

    myTEMPLATE.onChange = function(){
         myDOI.text = (this.selection && this.selection.text) || "000";
        };
    

    Xavier

  • ScriptUI readonly edittext with option justify = "center"?

    In the latest issue of the great Peter Kahrel of the ScriptUI guide, (whose value is approaching the incalculable ) there are examples of adding an input field "edittext" with a property of creation "readonly" to ensure that users cannot overwrite the text illustrated, and there are example of doing the same thing and making it justified to Center. However, is there any example that shows both at the same time. I want edittext readonly Center-justified.
    This seems to be at least more than one CC, as in CS5 question the following works while in CC2015 it does not work:

    function test() {}

    var l is new window ("dialogue", "Test");.

    e var = w.add ("edittext", undefined, "abcde", {readonly: true});

    e.Justify = 'center ';

    e.Characters = 10;

    w.Show ();

    };

    test();

    Add as resource string works in CC2015, but put ' readonly: true "in the curly brackets has no desired effect.

    function test2() {}

    var l is new window ("dialogue", "Test");.

    var e = w.add ('edittext {text: "abcde", characters: 10 to justify: 'Centre'} "");

    e.Characters = 10;

    w.Show ();

    };

    Test2();

    Maybe there's another interesting way to add the property "readonly" to the resource string or to add the property "justify" to the non-chaine method so that they will work in CC2015?

    Hi Silly - V, yes it is unfortunate that ScriptUI is not only not being updated, but it also breaks with each new version.

    support HTML? now, that would be great!

    Meanwhile, I got your test2 to work with the resource string

    function test2(){
        var w = new Window('dialog', 'Test');
    
        var eResource = "EditText { properties:{multiline:false, readonly:true}, text:'', justify:'center' } ";
    
        var e = w.add(eResource);
        e.characters = 20;
        w.show();
    };
    test2();
    
  • Why in the world EditText controls allow the RTF?

    A mug really, shot more than a question. This annoyed me intensely for a while now and it's all just off right destroy my workflow at present. Why EditText control allow the RTF? There is NO reason that it would be necessary that I can see, given that he throws errors EVERY TIME! Is this a limitation of the OS framework? ScriptUI framework by default that was never turned off? It goes the same for expressions in AE so. If you copy and paste anything, he still holds the formatting. I'm having this sort of thing for IDE so you can give a feel your code, but inside the ExtendScript in After Effects environment, it absolutely makes no sense. My biggest annoyance in that I keep running is one of my own scripts, ExtendScriptDeveloperUtility, it didn't really become something really up to end updates CC/CC 2014. Whenever I type a straight quote or a single right quote, it ALWAYS reverses for french quotes. I used modifiers when you type to force the typing quotes and inevitably when I change a character afterwards quotes turn they back automatically. It constantly causes an error "not finished string. Very annoying and aggravating. Now, I get that, EditText boxes were probably never intended to be used as an IDE. Incidentally, fields of Expression in the same way EI Act and they mistake every time because nothing rich can be evaluated, so I consider this a bug as simple text fields should be initially. Before we go down the road of the bug/feature, I just wanted to get a better sense as to why it is. Todd K., or the Jeff A., overview by chance?

    Support as a bug.

  • Validate a text field

    Hello

    I created a simple Panel with a user name and password like statictext and a pair of the text and a button to print to work as an "enter" button to change the text.

    So what I'm trying to achieve, is to have an "if/else" statement to validate the text.

    So I created 2 variables, a user name and a password.

    Exsample:

    var userName = "Test1234".

    As you can see here below, you can see the structure of the Group of the text, change the txt and button.

    groupOne: group {orientation: 'column', alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    myStaticTxt: StaticText {text: ' user name:'}, \

    myStaticTxt2: StaticText {text: ' password:'}, \

    },\

    groupTwo: group {orientation: 'column', alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    myEditTxt: EditText {text: "},

    myEditTxt2: EditText {text: "},

    },\

    groupThree: group {orientation: 'column', alignment: ['fill ', ' fill'], alignChildren: ["fill", "fill"],------}

    mygoBTN: button {text: 'Go'}, \

    When the user has written a text in the text for the username field, I want to validate as below.

    var goBTN = myPanel.grp.groupThree.mygoBTN;

    goBTN.onClick = function() {}

    If (myEditTxt == "Test1234") {}

    Alert ("access granted");

    } else {}

    Alert ("sorry, try again");

    }

    }



    But nothing happends, Miss me here.

    It is also possible for the textfield password hidden characters have?

    See you soon

    / HR



    I think it would be more like this:

    If (myPanel.grp.groupTwo.myEditTxt.text == "Test1234") {}



    Dan

  • Photoshop Script - Javascript: return of the input field value?

    Hello

    I've got the entry field following "edittext" rendered in a window. How can I find the value that has been entered in it?

    cal_char = cal.add ('edittext', [25,40,135,60], ' 1');

    I tried cal_char.value, but it does not work.

    Any help?

    Thank you!

    Try cal_char.text,

    x

  • Use the Edittext text as layer name?

    I build my own window prompt() for a script, but may not know how to use the text in the text field.

    What I want to do is to use the text as the name of the layer.


    Is there an input method or something I can use for this?



    Prompt() custom;


    var promptWin is new window ('dialogue', 'Pre dial the name');.

    var promptInputGroup = promptWin.add ('group');

    promptInputGroup.add ('statictext', undefined, ' name: ');

    var textFiled = promptInputGroup.add ('edittext', undefined, 'Demo');

    textFiled.characters = 20;

    textFiled.active = true;

    var groupTwo = promptWin.add ('group', undefined, "GroupTwo");

    groupTwo.orientation = "row";

    var okDialog = groupTwo.add ("button", undefined, "OK");

    var cancelDialog = groupTwo.add ("button", undefined, "Cancel");

    groupTwo.alignment = 'right ';

    promptWin.show ();

    Quentin

    Should be as simple as the definition of an onClick for button okDialog send the value to a variable or use the value immediately.

    var myVal;

    okDialog.onClick = function() {}

    myVal = textFiled.text;

    }

    You can also define an onChanging rather than the value to be sent in real-time as the user types. With each character typed, it would save everything right to your variable. I have to be careful though as malicious code could also quickly being sent to your script, depending on how you manage data the user enters.

    okDialog.onChanging = function() {}

    myVal = textFiled.text;

    }

Maybe you are looking for