dialogue vs palette

How can I edit text in Illustrator using a PALETTE window when you use the PALETTE DIALOG box works but with no, can anyone explain to me why?

my script is...

#target illustrator

var sourceDoc = app.activeDocument;

var myMaterials is ["FILME POLYESTER HOLOGRAFICO", "FILME BOPP STAND", "FILME BOPP BRANCO", 'PAPEL LAYER', 'PVC PLANO'];.

var myWin is new window ('dialog', 'Valves');.

myWin.orientation = "row";

myNewList = myWin.add ('dropdownlist', undefined, myMaterials);

myNewList.selection = 0;

myOkButton = myWin.add ('button', undefined, 'Ok', {name: 'ok'});

myCancelButton = myWin.add ('button', undefined, 'Cancel', {name: 'Cancel'});

myNewList.onChange = function () {}

var item = myNewList.selection

var myTextFrame = sourceDoc.textFrames.getByName ("MATERIAL");

myTextFrame.contents = item;

}

myWin.show ();

Hello Gustavo Del steep, Hi Ferrarezzi,.

Still very small and imperfeicoes HA.

The ok button is not necessary. The Cancel button does not work. And the first choice from the drop-down list is not working too (because there is no onChange event).

Perhaps it is better to do something like this:

function executar(valor){
    var sourceDoc=app.activeDocument;
    var myTextFrame = sourceDoc.textFrames.getByName("MATERIAL");
    myTextFrame.contents=valor;
    };

var myMaterials = [" --- ATENDER SELEÇÃO --- ", "FILME POLIÉSTER HOLOGRÁFICO", "FILME BOPP METALIZADO","FILME BOPP BRANCO","PAPEL COUCHÊ", "PVC PLANO"];

var myWin = new Window ("palette","Materiais");
myWin.orientation = "row";

myNewList=myWin.add ("dropdownlist", undefined, myMaterials);
myNewList.selection = 0;

myCancelButton=myWin.add ("button", undefined, "Cancelar",{name: "cancel"});
myWin.cancelElement = myCancelButton;
myCancelButton.onClick = function() {
myWin.close();
}

myNewList.onChange = function () {
    var mensageiro = new BridgeTalk();
    if (myNewList.selection != 0) {
        var opcao = String (myNewList.selection);
        mensageiro.target = "illustrator";
        var mensagem = "executar('" + opcao + "')\n" + executar.toSource();
        mensageiro.body = mensagem;
        mensageiro.send();
        myNewList.selection = 0;
        };
    };

myWin.show ();

Have fun

Tags: Illustrator

Similar Questions

  • Use dialogue "palette."

    I try to use the "palette" dialog, but when I run the script' dialog box opened and closed immediately, I tried to use #targetengine, but I want to close the script binary and binary file reads #targetengine.

    What can I do?

    Remove the line with the #targetEngine.

    Save as jsxbin.

    Open in a text editor.

    Add the line #targetEngine to the top.

    Wrap the entire binary file in an eval statement:

    eval ("binbinbinbinbinb");

    Save as .jsx (not .jsxbin).

    Ariel

  • The 'cluster of error code.vi error' will be based on the RT 'Dialogue & User Interface' work as expected in a RT application palette?

    The 'cluster of error code.vi error' is available to be included in an application of the RT, but it contains a 'FP. Node Title property"VI and a RT application contains all of the panels before, except when running in debug mode. This vi.lib VI will work properly in an application of the RT running on a cRIO?

    The Cluster error error Code VI works fine on the objectives of the RT, but the behavior is slightly different when the appellant VI has a front title which differs by its qualified name.  Note that there is a selection function that checks the mistakes coming out of the public Service. Node title.  If there is no title of façade, then simply will use name of the VI instead, so this VI certainly works on RT.

    Keep in mind that opening a VI reference and a property of reading is relatively a lot of time, so there is a significant performance impact when you call this VI on RT.  This attention to performance has been reported to R & D in 384767 car, but it can usually be avoided by ensuring to call only this VI when there is an error that must be reported to the user.

    Chris M

  • A very basic question dialogue IRT and the message boxes...

    What is the difference between a dialog box and in a message box?

    What the heck is a palette window?
    I'm quite confused...

    I'm quite confused...

    Need a glossary?

    http://msdn.Microsoft.com/en-us/library/Windows/desktop/aa511441.aspx

    (BING search engine for)
    WINDOWS glossary dialogue addressed
    )

    HTH

    Robert Aldwinckle
    ---

  • I want to increase the size of the image icons in the palette to open the file, see them much

    I need to increase the size of the image icons in the palette of open files, see them much. Used to be a slider, wasn't there?

    Open files dialogue is controlled by your operating system.

    If you need more great icons and you use 10 Windows, the dropdown Options is in the upper right corner.   See screenshot.

    What is the slider that you are looking for?

    Nancy O.

  • window/palette inside another palette not showing / made - bug? (dockable UI script)

    Hello

    I am writing a script where I could choose some psd in project files and script would be basically replace these DSP-s with the same files, but load them as * layers comps *, duplicate 2 times, and solo from the specific layers in each model in layers.
    The script works perfectly, but the problem starts when I try to add * Options * button that needs to load the new palette, with lots of boxes. He simply didn't want to with show/make the new palette within After Effects, but it works perfectly inside ExtendScript? Here are the screenshots:
    otpBTNproblem1.jpgotpBTNproblem2.jpg

    Is there something like a maximum video memory for a custom user interface, or it's just a bug in the software? I use AE cs6, and I tested it in cs5 and cs5.5 - same problem...
    whatever that is would be helpful.
    Thank you

    (Sorry for the bad eng)

    OK, there seems to be something wrong with the CS6 outright. After trying a number of ways, I then realized that NONE of the other scripts in my interface which had windows pop up would work. All these scripts worked perfectly fine before you test this script, something will not twisted here.

    I think that by not having is not the "winVinjOpt" and "winPsdOpt" window inside the function onclick code is the source of the problems. Once I placed the code inside the onClick functions, it is more has killed all pop-up windows. Having a window in limbo was to play with the system. Another thing that I would change too would be to do as well "winVinjOpt" and "winPsdOpt" a dialogue instead of the palette. This keep the window above everything and cannot be hidden behind your main or any other floating panels.

  • Window type "palette" and onClose event.

    Hi friends

    I m having a problem with an onClose event in a panel type "palette." Let´s try to explain the problem.

    Suppose I have this unique construction:

    var myDialog = new window ("palette", "My dialog box", undefined, {closeButton:false});})

    var bt = myDialog.add ('button', undefined, 'Ok', {name: 'ok'});

    myDialog.onClose = function() {}

    for example: app.activeDocument.layers.add ();

    };

    myDialog.show ();

    If I change the window to type 'dialogue', everything seems preety good, but if I keep the dialogue as a "palette" box, and then the 'Ok' button does not close the dialog and, of course, the onClose does not.

    PS: I need the onClose because event I want closing code executed even if the user press "ESC" rather than use the OK"" button.

    No idea how to handle or an alternative to make the button and onClose works?

    Thank you very much

    Best regards

    Gustavo.

    It does not work because the pallets and Illustrator don't communicate with each other, to call illustrator in a palette, you MUST use BridgeTalk, search on this forum, there are many examples.

  • Help: open multiple AI files produced error in the Palette. (Error: 8702, there is no document.)

    I try to open the files have mulitple via the palette dialog box but it fails on the error: 8702, there is no document. But if I change to win var = new window ('dialogue', 'Batch'); Open the file works well. Did someone help out me?

    var txtSourceFolder = win.add ("edittext", undefined);

    btnOk var = win.add ("button", undefined, "Run");

    {btnOk.onClick = function ()}

    Try

    {

    var sourceFolder = new Folder (txtSourceFolder.text);

    var srFileType = "*.ai.

    var files = sourceFolder.getFiles (srFileType);

    If (sourceFolder! = null)

    {

    If (files.length > 0)

    {

    for (i = 0; i < files.length; i ++)

    {

    var optRef = new OpenOptions();

    optRef.updateLegacyText = true;

    sourceDoc = app.open (files [i], DocumentColorSpace.CMYK, optRef); Returns the document object

    }

    Alert ("the files are saved as HAVE in" + destFolder);

    }

    on the other

    {

    Alert ("no file found");

    }

    }

    }

    catch (Err)

    {

    If (err.substring)

    {

    Alert ("Error:" + err);

    }

    on the other

    {

    Alert ("Error:" + (err.number & 0xFFFF) + ', ' + err.description);

    }

    }

    }

    Win.Center ();

    Win.Show ();

    You must use BridgeTalk to have your talking Palette in Illustrator, search the forums, we have published several scripts that show how.

  • Reference UI info (window, dialog, palette, etc.) for scripts to HAVE

    I'm looking for information of standard reference on elements of user interface like the pop-up windows (dialogs, palettes, etc.). I went through the Scripting of Illustrator CS6 Javascript reference guide and also the CS6 Scripting guide, checking every mention of the words 'Window', 'Dialogue', 'Pallet' etc. (it there is no much), over related terms such as "edittext" and "slider" (which apparently do not exist in these documents in all) and can't find what I'm looking for.

    ----------

    I'm trying to script a simple information box that contains information generated by a script that doesn't have to be closed before the user continues to operate.

    What I'm trying to find out is essential. Looking at other scripts I realized that you can create a popup like this box:

    var box = new Window('dialog', 'Some title');
    
    var panel = box.add(panel, undefined, 'Panel title');
    panel.add('edittext', undefined, 'Default value');
    panel.add('slider', undefined, /*Default numeric value*/,/*min*/,/*max*/);
    
    var group = box.add(group, undefined, 'Group title');
    group = area_len_box.add('group', undefined, 'Title (not displayed)');
    group.orientation='row';
    group.closeBtn = group.add('button',undefined, 'Close', {name:'close'});
    group.closeBtn.onClick = function(){
      box.hide();
      return false;
    }
    

    .. .this which is enough for a very basic entry system, but which must be closed before the user can return to their work - and I can't find any resource that gives the full options:

    • What are the other options for "new window"? I am aware of the "palette", which appears to need a table of four coordinates such as [20,20,100,100], but he clearly needs something else too, as each pallet I did instantly closes. And what else is there beyond the window and the Palette?
    • What other input devices are there beyond edittext and slider, and what are the parameters they each need?
    • What can go in the s 'undefined' that I see everywhere wherever they are used?
    • etc etc.

    There must be a reference to it somewhere, but I can't.

    Here is an attempt at a consolidated whole:

    Script interface elements are similar for all Adobe applications - called "ScriptUI". There are two PDF files:

    There are two ways to browse the structure of the object to see what is available:

  • Save changes dialogue stops batch?

    Hello

    I created a simple order action that made a small change to an EPS file and then export to WMF.

    On the last step, I save the file > close.  This opens the dialogue window "Save changes to origin doc?" below (see chart).  I choose "do not save" and stop the action.

    However, every time he stops the lot on this dialog box.

    Is there anyway to automate this step so that it does not interrupt my lot?

    Thanks for your suggestions.  I lose hours of work!

    t

    Screen Shot 2013-02-12 at 3.25.56 PM.PNG

    Check the option 'remove all dialog boxes' in the actions palette and rather than using a file close explicit in the action itself uses the respective option in the batch processing dialog box itself...

    Mylenium

  • Calling functions from the palette of the user interface

    Hello

    As I understand it, you can not call complex functions in a scripted UI palette, only from windows 'dialogue' (which are usless in my case) because I need the persistence of a palette.

    I have a set of scripts in use, now that is accessed from the usual "file-scripts folder" within Illustrator itself (about 27 of them).  I want a range of script window so that users can access without the usual mouse clicks on the menu system.

    I am able to call a single function of type "Hello World" using the method "onClick()' by a button of a window of the actions palette, but I can't use my scripts to regular work inside a function that is called by the button.  In X-Code, I could write my scripts individually, then simply add to a floating window via a separate function when they have been completed.  But, I find a little more complicated Javascript.

    If I copy my other script code in the script palette window function, it works, but it runs before I click the button! -After in series, then the palette window is displayed (?).  If I try to use with 'onClick' execute() method, the script simply opens in the SDK, it will not be and runs in Illustrator.

    I take these two as clear indications that I have no idea what I'm doing (or I'm trying to do the impossible).

    I found someone with a similar problem, but they were After Effects script and offered this solution:

    system.callSystem ("afterfx - r" / C/Program Files/Adobe/Adobe After Effects CS3/Support Files/Scripts/GlobalVars.jsx ' ");

    Is this all I can in Illustrator that allows me to call (or run) my other scripts/functions and make them run in Illustrator?

    Thanks for any help!

    Well, here it is!

    I found this link:

    http://www.davidebarranca.com/2012/11/ScriptUI-BridgeTalk-persistent-window-examples/

    (If stumble you upon this, thank you davide barranca!)

    Now, I can make changes for scripts in one place and everyone will get updates once they restart their window.

    Works like a charm and is just what I needed!  Thank you again for your help!

    #target illustrator

    (var scriptToLoad = nouveau fichier ("SCRIPTS/JAVASCRIPTS S:/NEW IN USE MAINTENANT/02) Make/01 b) form P - 16 UP.jsx");

    var win = new window ("palette", "copying objects '");

    var btnSelect = win.add ('button', undefined, 'Copy');

    btnSelect.onClick = function() {}

    scriptToLoad.open ("r");

    var bt = new BridgeTalk;

    BT. Target = "Illustrator".

    script var = scriptToLoad.read ();

    scriptToLoad.close ();

    BT. Body = script;

    BT. Send();

    } / / end of function

    Win.Center ();

    Win.Show ();

  • Dialog boxes are open but PALETTES and WINDOWS disappear immediately!

    When I do a 'dialogue' is the type of window, it remains open, but if I do a "palette" or 'window', it closes immediately. How can I solve this problem? I don't know that it's simple
    The script below shows the problem

    //DIALOGS stay open but PALETTES and WINDOWS disappear straight away!
    //When I make the window type a "dialog" it stays open but if I make it a "palette" or "window" it closes straight away. How do I fix this problem?
    //The below script demonstrates the problem
    
    w = new Window ("dialog", "DIALOGS stay but PALETTES and WINDOWS disappear straight away", undefined, {borderless: false}); // the dialog stays on the screen
    
    w.margins = [30,30,30,30];
    var myInputGroup = w.add ("group");
    myInputGroup.add ("statictext", undefined, "Problem:");
    var myText = myInputGroup.add ("edittext", undefined, "DIALOGS stay open but PALETTES and WINDOWS disappear straight away");
    myText.characters = 70;
    w.layout.layout();
    myText.active = true;
    var myButtonGroup = w.add ("group");
    myButtonGroup.alignment = "right";
    myButtonGroup.add ("button", undefined, "OK");
    myButtonGroup.add ("button", undefined, "Cancel");
    if (w.show () == 1)
    alert (myText.text);
    else
    exit ();
    
    // same script were window is a palette
    
    q = new Window ("palette", "DIALOGS stay but PALETTES and WINDOWS disappear straight away", undefined, {borderless: false}); // the palette disappears straight away
    
    q.margins = [30,30,30,30];
    var myInputGroup = q.add ("group");
    myInputGroup.add ("statictext", undefined, "Problem:");
    var myText = myInputGroup.add ("edittext", undefined, "DIALOGS stay open but PALETTES and WINDOWS disappear straight away");
    myText.characters = 70;
    q.layout.layout();
    myText.active = true;
    var myButtonGroup = q.add ("group");
    myButtonGroup.alignment = "right";
    myButtonGroup.add ("button", undefined, "OK");
    myButtonGroup.add ("button", undefined, "Cancel");
    if (q.show () == 1)
    alert (myText.text);
    else
    exit ();
    
    

    Thanks in advance

    Add at the beginning of your script:

    #targetengine "Trevor."

    Substances

  • Modeless window by using the "palette" does not remain upward in CS5

    I have a problem running a modeless dialog box with CS5 (on 64-bit Windows).  My own script does not stay in place and either don't extract of SnpCreateDialog.jsx that comes with the ESTK and is supposed to demonstrate modeless dialog boxes.  I tried:

    1. From the Scripts panel
    2. Add #target photoshop
    3. Be sure that the drop down menu says Photoshop, no CTSK

    as suggested in an older discussion at http://forums.Adobe.com/message/3008230#3008230 .  (I decided to make a new discussion as this one was marked answered.)

    It also does not stay in place when moved to the folder of Photoshop Scripts and run on the file menu in Photoshop.

    The corresponding code in SnpCreateDialog.jsx is:

    function SnpCreateDialog() 
    {
         this.windowRef = null;
    }
    
    /**
     Functional part of this snippet. 
     
     Create a window of type "palette" (a modeless dialog) and display it.
    
     @return True if the snippet ran as expected, false otherwise.
     @type Boolean
    */
    SnpCreateDialog.prototype.run = function()
    {
         // Create a window of type palette.
         var win = new Window("palette", "SnpCreateDialog",[100,100,380,245]);  // bounds = [left, top, right, bottom]
         this.windowRef = win;
         // Add a frame for the contents.
         win.btnPanel = win.add("panel", [25,15,255,130], "SnpCreateDialog");
         // Add the components, two buttons
         win.btnPanel.okBtn = win.btnPanel.add("button", [15,65,105,85], "OK");
         win.btnPanel.cancelBtn = win.btnPanel.add("button", [120, 65, 210, 85], "Cancel");
         // Register event listeners that define the button behavior
         win.btnPanel.okBtn.onClick = function() {
              $.writeln("OK pressed");
              win.close();
         };
         win.btnPanel.cancelBtn.onClick = function() {
              $.writeln("Cancel pressed");
              win.close();
         };
    
         // Display the window
         win.show();
              
         return true;
              
    }
    
    /**
     "main program": construct an anonymous instance and run it
      as long as we are not unit-testing this snippet.
    */
    if(typeof(SnpCreateDialog_unitTest) == "undefined") {
        new SnpCreateDialog().run();
    }
    
    
    

    If I put a breakpoint on the "return true;" line, then I see that the dialog box, in fact, was created and is visible, but he came back to win.show () and will disappear as soon as the script continues.

    Any help would be appreciated.

    Kenneth Evans wrote:

    The advantage of a modeless dialog box, is that you can continue to do things in Photoshop while the dialog box is in place.  At least, I suppose, since I don't have to work, including the example ESTK.

    Sorry but no, most of the Photoshop UI is disabled while a script is running even if the script displays a palette window.

    A dialogue window waiting for show() end. This is what makes the modal dialog boxes. A palette window does not expect show() end. He runs the rest of the script.

    In the example you posted the entire script after the window display is return true, then ends. That is why there is no blink the window. If you put a line of $.sleep (1000) before the real return line, that display the windows until sleep wait times then the script will exit and the window will close. That's why with Photoshop palette windows are really only useful progress bars or other type of script status windows.

    Although windows palette can allow the user to intreact with application UI while the window is displayed and does not work with Photoshop. The window shows only while the script runs and Photoshop UI interaction limited a running script.

    I tested windows palette in CS2, CS3, CS4 and CS5 with the same results. The window shows only while the script is running.

    With Photoshop if you want the user to interact with the user interface you will need to create a Panel.

  • How to execute the method of dialogue of the handler of a button?

    I created my first dialog of the samples, but I can't find how to execute a method in my handler of a button dialog box. Can someone tell me please in the right direction?

    function CreateDialog()
    {
    this.windowRef = null;
    }

    CreateDialog.prototype.run = function()
    {
    .. .floating a lot of vars

    Create a palette type window.
    var win = new window ('dialogue', 'Spray generator Element', [iTop ILeft then, iWidth, ILeft iTop then + iHauteur]);  Bounds = [left, top, right, bottom]
    this.windowRef = win;

    Add a frame to the content.
    win.btnPanel = win.add ("panel", [iPadding, iPadding, iWidth-iPadding, iHauteur-iPadding], "");

    ... Add a bunch of other things...

    win.btnAdd = win.btnPanel.add ('button', [win.btnRemove.bounds.left - iPadding - iButtonWidth, win.lstImages.bounds.bottom, + iSmPadding, win.btnRemove.bounds.left - iPadding, win.lstImages.bounds.bottom + iSmPadding + iTextHeight], "add");

    win.btnAdd.onClick = function() {}
    TODO implement this
    var f is File.openDialog ("open a file");.
    win.lstImages.add ("item", f.displayName);
    This. EnableControls();    <-problem is on this line here!
    };

    This. EnableControls();  <-this works

    Display the window
    Win.Show ();

    Returns true;
    }

    CreateDialog.prototype.EnableControls = function () {}

    var result = true;
    result = result & & (this.windowRef.ddlPaths.selection! = "");
    result = result & & (this.windowRef.lstImages.items.length > 0);

    this.windowRef.btnOK.enabled = result;
    }

    I posted a response to this here: http://ps-scripts.com/bb/viewtopic.php?t=2889

    X

  • palette ScriptUI window

    Hello world!

    for an indesign script, I want to have a palette with sliders window in order to change some values and instantly see the results. but just at the beginning, I ran into trouble.

    a simple script like

    var window = new window ("palette", "title");
    var result = window.show ();

    works in the ide to extendscript, or at the bridge, but not in indesign! (all cs3, windows)

    a normal dialogue window works well.

    I think that the documentation somewhere that photoshop does not support windows palette, but nothing is said about indesign - this is why I thought it should actually work.

    any ideas?

    Thank you!

    w

    InDesign (like Photoshop) runs each script in a new script engine. When the script is finished running, the script engine goes. If you are showing a palette, it goes too far (very quickly). If you are showing a modal dialog box, the script did not complete, and the dialog box remains.

    To display a palette, you need to run from a persistent script engine, named. You create one of those who use the #targetengine directive in your script. Even in this case, to run from the ESTK, the engine must already exist. You can place a small script in a folder named "startup scripts" under the folder of Scripts for InDesign. When ID starts, it searches all jsx files in folders named "startup scripts" under "Scripts" (and it's a hierarchical search - get referrals in all folders) and works, creating persistent script engines for all who have the targetengine directive.

    In PS, you can create a persistent engine yourself. Meanwhile, PS has 1 engine for BridgeTalk, so you can send a message from BT to ch at the request to open a palette.

    Bob

Maybe you are looking for