[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

Tags: InDesign

Similar Questions

  • Show/hide the problem and playing of the symbols

    Hello.

    I have a problem with the instructions Show/Hide and play - my problem here:

    I have 4 buttons (symbols) in the stadium: "sectionOption1a_Btn", "sectionOption1b_Btn", "sectionOption1c_Btn" and "sectionOption1d_Btn".

    I also, what I call, 4 'options': 'Option1a', 'Option1b', 'Option1c', 'Option1d'.

    Each of these symbols of 'Options1X' have a 'melted' and 'melted' animation - 0 ms and ms 2000, respectively (within them).

    Each button runs each own option:

    "" 'sectionOption1a_Btn' ' CLICK ' symbol 'Option1a' tracks

    "" 'sectionOption1b_Btn' ' CLICK ' symbol 'Option1b' tracks

    "" 'sectionOption1c_Btn' ' CLICK ' symbol 'Option1c' tracks

    "" 'sectionOption1d_Btn' ' CLICK ' symbol 'Option1d' tracks

    All "Options1X" are hidden, except one that is active.

    The problem:

    Let's say I have "Option1c" active and I want to go to the "Option1a". So, I click on "sectionOption1a_Btn". When I do this, I want the "Option1c" to run is "bland out' (inside himself, to 2000 ms) and then run " Option1a" 0 ms - it is own"fade"while keeping all the other "Options1X" hidden, of course."»

    I hope that I didn t more complicated my explanation.

    Here´s a schema:

    Schematic Control buttons.jpg

    Thanx.

    Hi there, you can implement such a feature in 2 tracking variables. YER essentially saying 'currentOption' to unfold on click of a button and the definition of the "requestOption" according to the click button. At the end of the coast anim current outro, yer by calling the 'playRequest' function to play the requested side.

    Put this question to the stage.compositionReady event:

    var currentOption = null; / / a, b, c and d

    var requestOption;

    called by the event of timeline.complete at the end of each Option

    sym.playRequest = function() {}

    sym.getSymbol("Option1"+requestOption).play ("is");

    currentOption = requestOption;

    }

    called when the button is clicked

    sym.btnClick = function (request) {}

    requestOption = request;

    {if (currentOption)}

    sym.getSymbol("Option1"+currentOption).play ("fadeOut");

    } else {}

    sym.playRequest ();

    }

    }

    Put this on a button click:

    sym.getComposition () .getStage () .btnClick ("a"); / / or b, c and d for each button

    Put this question to the event timeline.complete of each Option symbol:

    sym.getComposition () .getStage () .playRequest ();

  • Problems with the layout themed to show/hide the region 25

    Hi all, Ive hit another question that I hope someone can help with...

    APEX 4.2.4 on XE... Theme 25.

    I've reproduced this login as apex.oracle.com [email protected] password newpass 291 3 application page.    (admin/admin is also implemented as a UN/pw)

    I have a skin region see the this Im using as a region of select query. There are a number of boxes, and a couple of display only fields that have values returned in it.

    I I set out them in a row, and after 3 items, I start a new line with the other 3 articles... that is

    X X X

    X X X

    Except that with the region set to show/hide and the model of the value without tab, no sidebar I get.

    X X

    X

    X X

    X

    If I change the standard region it works OK, and if I change models, it seems ok.  Ive tried all the combinations of columns, etc, but nothing helps...  Im trying to figure out if Im missing something, or I've hit a bug any... (almost certainly the old...) ...

    Thank you very much indeed

    Richard Legge wrote:

    I have a skin region see the this Im using as a region of select query. There are a number of boxes, and a couple of display only fields that have values returned in it.

    I I set out them in a row, and after 3 items, I start a new line with the other 3 articles... that is

    X X X

    X X X

    Except that with the region set to show/hide and the model of the value without tab, no sidebar I get.

    X X

    X

    X X

    X

    If I change the standard region it works OK, and if I change models, it seems ok.  Ive tried all the combinations of columns, etc, but nothing helps...  Im trying to figure out if Im missing something, or I've hit a bug any... (almost certainly the old...) ...

    The difference between the models of the region is that the Standard region has defined Points of view and the show/hide does not work. This is the mysterious properties that Oracle has not yet bothered to document. Their omission of this model is indeed likely to be a bug.

    Create a copy of the region show/hide template and add a point of view for the body of the region (content):

    Name: Body of the region

    Substitution of template: BODY

    Grid Support: Checked

    The maximum fixed grid columns: - 1


    Use the new model to show/hide for the region of select query.

  • Don't hide and not available in advanced Actions - 7 Captivate

    I'm very new to using Captivate, so maybe it's an obvious solution.  I have a screenshot below what happens when I try to create an advanced Action.  I want to show and hide a legend when a button is clicked.  Cannot use a roll because it is not compatible with HTML 5 and you can not roll something on a tablet or iPad.  As you can see Show, Hide and Enable are disabled. I tried to create a new project and do the same thing and it works very well.  But I don't want to start a new project and recreate the other interactions that I have already installed.  Also, I would like to know what is the cause, so I repeat again.

    Any help or suggestions you can provide are greatly appreciated.  Thank you.

    advancedactionsmissing.png

    Success!  I found the problem.

    I went through and delete a slide at a time and then tested to see if I could add a tip Action.  About slide 19 (of course) I was able to make it work.  After cancellation and put the blade back in I could not add an action.  So that was probably the problem.  After looking at the settings for the slide, I was wondering if the characters of < and=""> > on the slide name could be the problem.  I took out them and viola - this has worked.

    So I learned my lesson - only letters and numbers in my slide names in the future!

    Thank you all for your useful ideas and thoughts.

  • Lack of "automatically hide and show the menu bar.

    Hi all, I want to hide my menu bar. I watched how disappear - it turns out that the checkbox "automatically hide / show menu bar" is missing. It is supposed to be under "use donkere menubalk en donker Dock. Why is it missing?  Thank you very much!

    Hi Mjappie

    This feature has been added in El Capitan.

    You must update to 10.11.3 to hide and show the menu bar.

  • By using the password to hide and show fields? (instead of toggle)

    Back in George_Johnson 2010 post the script below, it allows you to turn on or off the field with a password.  I tried and it worked perfectly.  But when I had a friend try my document, there just by clicking on following in disabled fields (buttons) trying to make them work.  I realized that I really need to do is to hide rather than turn them off.  I thought at the script below could be changed to show/hide instead of turn, but I don't know enough about java still to do.  I started to try, but I think that I do not yet know enough.  My buttons I would like to hide/show are X, Y and Z.  Thank you George or anyone who has an idea about that.

    Zac B., Cypress CA

    (function () {}
    Get one of the fields in the Group var f = getField("private.name");

    Determine the new State readonly, which / / is the opposite of the current state var readonly =! f.ReadOnly;

    var readonly_desc = readonly? 'disable': 'enable '.

    Ask the user password var resp = app.response ({cQuestion: "To" + readonly_desc + "fields, enter the password:", CTitre: "Password", bPassword: true cLabel,: "Password"});

    switch (RESP) {}

    case 'votre_mot_de_passe': / / your password goes here getField("private").readonly = readonly;        App.Alert ("the fields are now" + readonly_desc + "d", 3);        break;

    zero case: / / the user pressed pause of button cancel;

    default: / / Incorrect app.alert password ("bad password.", 1);        Break ;}

    })();

    Response toSelect to enter the text of your comment

    You can add the following line after the one that is similar:

    getField("private").display = readonly? Display.Hidden: display.visible;

  • Y at - it shows a bug with Hide and regions in 4.1.1.00.23?

    Hi all

    I tried to put a subregion Hide and Show area on a page. It is supposed to have a subregion of the form of each side (i.e. above and below).

    'View' of the region will show a "View only" control with a text and a picture inside.

    When I create the subregion Hide and Show area and add the control. everything seems to work as expected. However, when I then moves the subregion so that it is now between the subregions two form, 'view' is no longer something watch. The arrow changes, but that's all. It's as if the display control had ceased to exist. Move that the subregion any where from there does not change the behavior - show it only control is not displayed.

    Does anyone know if this is a known issue with 4.1.00.23? If so, is there a workaround?

    Thank you very much

    PT

    There seems not to be a bug and it seems not be a workaround.

    To recreate (at least in version 4.1.1), in the tree, create two subregions of form and add some controls. Create a subregion Hide and Show, and then add a control. If you run the page now, it should appear normal (i.e. the content in the skin and see the subregion will be visible when you click on show). Now, move the sub-region Hide and Show via drag and drop to between the two sub-regions form. If you run the page now, it should appear that there is no content in the skin and see the sub-region, despite the fact that, in the design view control is always there.

    See the bug itself, swap component mode. You will notice that even if the sequence of sub region numbers appear correct, the physical order of the sub regions will always be as they were when the subregion to hide and see the creation.

    Thus, it will look something like this:

    Shape 90 1 sub-region

    Subregion 230 form 2

    100 hide / display the subregion<-- in="" tree="" view,="" this="" will="" appear="" to="" be="" between="" form="" sub="" region="" 1="" and="" 2,="" in="" component="" view,="" it="" still="" appears="" at="" the="">

    To fix, go back to tree, drag hide and show of the subregion at the bottom, return to the view of the component, change hide and show of the subregion it and manually change the value of the sequence to a value between Sub regions 1 and 2 form. This will be:

    • go hide and show the sub-region to form Sub region 1 region 2 Sub form
    • the content of the Hide and Show under region now appears when you click to perform the operation to see the

    Hope this helps someone someday.

    PT

  • Captivate 9, sensitive slides on a Mac and a PC publish the slides, timed objects (show/hid) do not shown in the final html5.

    I have some 9 Captivate, sensitive slides on a Mac and a PC.

    When I published the slides, timed objects (show/hide) not shown in the final html5.

    Some slides contain objects such as some graphics (png), the arrows and text boxes that have a period of delay or show that for a given time.

    They work within Captivate when I executed the chronology, but do not yet show in the published code. I tried several different browsers.

    Any idea why these objects do not appear?

    Thank you, I have yet seen that I didn't just look.  Once, he toured. Jim

  • How can I prevent Captivate to advance to the next slide, after the end of the audio and I click on click to show/hide sidebar box?

    I currently have a slide that plays audio.  While usage is listening to the narration that I can click on three different click the boxes with advanced actions to open and close text boxes, I want the user to read the value.  When reading narrative ends and I'll click on the boxes to click to read a text box, it moves to the next slide.  I understand that I may have to replace the box with smart buttons click but I don't know how to stop the progression to the next slide.  I already have a next button that is put on pause until the user clicks.  Any help would be greatly appreciated.  I'm on a tight schedule.

    Quickly, I created a sample file, just have a slide with three form buttons that act as the toggles and a next button. The first three buttons break late exactly at the same time and the next button.

    Since it's the slide by clicking the audio stops no audio at all (common misunderstanding). I created a shared action, with the purpose to display and the variable (mine are labeled v_one instead of v_visib) as parameters:

    StarOne is what you want to show/hide. You can click on infinite time on each key to show/hide this element. He won't interfere not audio, once he started playing he will continue. When the audio is finished, you can still continue to click. Just click on the next button will advance to the next slide. It's my calendar

    No need to rewind the playback head in this case at all.

  • hide and show the region - hide by default

    Hello world
    I had a hide / show region on my page. I want to hide this default region (on each page load).
    In fact, it is open by default.
    How can I get that?
    I have tried many things, searched a lot of problems that.
    But I can not find a solution, which helped me.
    I am using a theme not Standard apex.
    Any suggestions?

    First run page using firefox or chrome and identify the name of the region, i.e. the #REGION_ID # in the model translates into something like "region5" when rendering.

    Change Page, in the section Javascript executed when the Page loads, enter the following command

    hideShow ('region5', 'shIMG5', '', '');

    This should toggle the current show / hide mode.

  • Automatically expand a Hide and Show model region when the Page loads

    Hello

    I work with a Hide and Show region model, and I'm trying to accomplish the following:

    When my Page loads, if a PX_ID is not null, hide it and see the area should be extended automatically.

    I use Apex 4.1.1.

    Any ideas?

    Thank you

    Erick

    Hello Joe,

    Thank you for your response.

    This morning, I was looking for a solution in the forum and I could not find anything. Now, I decided to keep looking for more careful and I found a solution.

    For those interested, check this thead element: Re: hide/show the region

    Basically, I created a dynamic Action with the Code JavaScript: $('.t20RegionHeader') ('img') .children ravishing ();

    Thank you

    Erick

  • Hide and show region - open if Item not Null

    Hello
    I use APEX 4.0 and can not find a way to get the skin and see the region develop if a Page element has a value (is not Null) in the region, without clicking the sign more. I would like it done automatically based on an item that has a value or not. null or not null. I know how to have always hide it and see the region see the/develop once the shape is present. But if the item is null the region hosts not on the loading of the page, but when an element has the value when the page opens, I want the area to be open / extend without having to click the sign more. I searched the forum and found a large number of threads to have just the Hide and Show open area / develop once the form on the page is open, but not what I need now. Thanks for reading this thread and look forward to a support for this issue.

    Hi Charles,

    I created a dynamic action on page 7, it works as expected.

    This code will only work with your current theme, because the rocker is made according to the css class of the > icon (as you can see in the live action)

    Thank you

  • Hotkeys to show/hide the tool Options and the Photo to PSE11 tray

    LOL - I just find it has shortened F4 to show/hide the xD Tool Options
    Overall I have disabled "Auto Show Tool Options" option and use F4... Thanks Adobe you have not left it without no solution!

    Title of the message was edited by: Brett N

    And have you tried F5? You will soon use the F4 and F5 to clear your display

  • Show/Hide - advanced action buttons and images

    So, I thought I had a handle on usage shares advanced to show/hide, but apparently not.

    Here's the scenario:

    -Screen where the user must select one of the 6 options

    -When the user clicks on one of the 'boxes' of the option a check should appear and audio should play

    -All other "cases" should be disabled to avoid audio duplication

    Here's what I did to try to get this working:

    -' Boxes' are buttons, click on success:

    * Success box contains audio that plays (this works)

    Success of the button execute advanced action:

    > hide all other buttons on the slide (it does not)

    > display an image of a check mark in the "checkbox" which has been clicked (does not work)

    > go to the next slide (works, audio from the success box once completed)

    Thoughts? Help! Thanks in advance!

    Hello, unknown fan

    Overlay buttons will not work, so let this idea alone.

    I really want to finish this blog post on audio and widgets. Just an idea and will try to be at the time where I found the time to try something. Why don't you attach audio to an initially invisible object that you show with the same advanced action? This object can be a shape with no stroke and a fill alpha of 0% so that it is invisible to the user. You will have time before the sound can play completely before going to the next slide.

    Lilybiri

  • hide and show the icon view using if else statement

    is - it possibleto hide and expose the display icon using if else statement? I try to use erase them but I don't know how show it on again after that I want to come back. Thank you

    There are two functions... EraseIcon and Exposeicon

    Mike

Maybe you are looking for