Dialog vs palette

How do I change a text in Illustrator using a window type PALETTE when using DIALOG PALETTE works but with no, someone can explain me why?
my script is...
#target Illustrator
var sourceDoc=app.activeDocument;
var myMaterials = ["FILME POLIÉSTER HOLOGRÁFICO", "FILME BOPP METALIZADO","FILME BOPP BRANCO","PAPEL COUCHÊ", "PVC PLANO"];
var myWin = new Window ("dialog","Materiais");
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, "Cancelar",{name: "cancel"});
myNewList.onChange = function () {
    var item=myNewList.selection
    var myTextFrame = sourceDoc.textFrames.getByName("MATERIAL");
    myTextFrame.contents=item;
myWin.show ();

I have this script that I created from other examples, but I am unable to make a specific text is changed according to the selected radiobutton, can someone help me, I made numerous unsuccessful attempts here
#targetengine main
#target Illustrator
var sourceDoc = app.activeDocument;
var aFile = File ("~/Desktop/FORMS/clientes para dropdown.csv");
aFile.open('r');
var txtFile = aFile.read();
aFile.close();
var iText = txtFile.split("\n");
var myClients = []
for (i=1; i<iText.length-1; i++) {
    var newElement = {};
    newElement=iText[i]
    var txtCliente = newElement.replace( /"/g, "" );
    myClients.push(txtCliente)
function executar(valor){   
    var sourceDoc=app.activeDocument;
    var myTextFrame = sourceDoc.textFrames.getByName("MATERIAL");
    myTextFrame.contents=valor;
function executarClient(valorClient){   
    var sourceDoc=app.activeDocument;
    var myTextFrame = sourceDoc.textFrames.getByName("CLIENTE");
    myTextFrame.contents=valorClient;
var myMaterials = ["FILME POLIÉSTER HOLOGRÁFICO", "FILME BOPP METALIZADO","FILME BOPP BRANCO","PAPEL COUCHÊ", "PVC PLANO"];
var myWin = new Window ("palette","Dinamic Form");
//myWin.onShow = function () {myWin.size = {width: 500, height: 300}} // tamanho da janela
myWin.orientation = "row";
var myDropdowm = myWin.add('group');
myDropdowm.orientation = "column";
myDropdowm.alignment = "top";
var grpMat=myDropdowm.add('group');
    grpMat.alignment = "right";
    grpMat.add ('statictext', undefined, 'Materiais: ');
    var myNewList=grpMat.add ("dropdownlist", [0, 0, 220, 19], myMaterials);
        myNewList.selection = -1;
myNewList.onChange = function () {  
    var mensageiro = new BridgeTalk();
    var opcao = String (myNewList.selection);
    mensageiro.target = "illustrator";
    var mensagem = "executar('" + opcao + "')\n" + executar.toSource();
    mensageiro.body = mensagem;
    mensageiro.send();
var grpClient=myDropdowm.add('group');
    grpClient.alignment = "right";
    grpClient.add ('statictext', undefined, 'Clientes: ');
    var myNewListClient=grpClient.add ("dropdownlist", [0, 0, 220, 19], myClients);
        myNewListClient.selection = -1;
myNewListClient.onChange = function () {  
    var mensageiroClient = new BridgeTalk();
    var opcao = String (myNewListClient.selection);
    mensageiroClient.target = "illustrator";
    var mensagem = "executarClient('" + opcao + "')\n" + executarClient.toSource();
    mensageiroClient.body = mensagem;
    mensageiroClient.send();
var bobinamento_group = myWin.add ("panel");
bobinamento_group.alignment = 'right';
bobinamento_group.add ('statictext', undefined, 'Bobinamentos: ');
bobinamento_group.alignChildren = "left";
     var rbtn1=bobinamento_group.add ("radiobutton", undefined, "Nº. 5");
     var rbtn2=bobinamento_group.add ("radiobutton", undefined, "Nº. 6");
     var rbtn3=bobinamento_group.add ("radiobutton", undefined, "Nº. 7");
     var rbtn4=bobinamento_group.add ("radiobutton", undefined, "Nº. 8");
     var rbtn5=bobinamento_group.add ("radiobutton", undefined, "Outros");
myWin.show()

Similar Messages

  • [JS][CS3] Method failing in palette

    Hi,
    Although I experience the problem in Illustrator CS/Win, I suspect someone might have been through a similar problem in InD, and it might expose some sort of bug. I seek to either have such a bug confirmed or grasp a solution. That's why I'm posting also on this forum.
    I wrote a method to check whether the active document's selection is exactly two vertical guides, and it works well when isolated, run from either Scripts menu or from ESTK. But once attached this method to a button in ScriptUI palette, it continuously fails to do its job. Again, it works OK from a modal dialog (which however is not a solution to me, since it does not allow interaction).
    It claims that "there is no document", although it is there and has the expected selection. I tried a whole bunch of try/catch, if'fing tests, referring to activeDocument as well as documents[x], passing a ready-to-use docref, repeating the #target directive, restarting Ai/ESTK, but it stubbornly claims there is no document.
    Anyone having a workaround? It's a showstopper :( I have to stick with palette type of window. :(

    Yes, Dave, I do this kind of debug all the time, writing either to console or showing alerts, but what good does it when you see that there IS a document but an alert shows that you fell into if(!app.activeDocument) ?
    Try to attach to a button any function referring to a selection, for instance: returning width of the selected object. Try both types of window frame: 'dialog' and 'palette'. I'd be curious what results you'd get.
    Unless I'm doing something wrong, I think there might be some problem with window layering.
    Art

  • JS CS3 Simple Dialog to change doc starting page.

    This example presents the user a dialog telling them the what their current document starting page is. The user can then change the value and update the starting page number. For some reason I'm getting a error Cannot handle the request because a modal dialog or alert is active. I have set myDialog.close(); before the if statement so should this not stop this error?
    I have not added any checks to ensure a doc is open in ID yet.
    var myDialog = new Window('dialog', ' Starting Pg No');
        myDialog.dPgNo = myDialog.add('panel',undefined,'File details');
        myDialog.dPgNo.alignChildren = 'left';
        myDialog.dPgNo.myPgNo = myDialog.dPgNo.add('group');
        myDialog.dPgNo.myPgNo.group = myDialog.dPgNo.myPgNo.add('group');
        myDialog.dPgNo.btnGroup = myDialog.dPgNo.add('group');
        with (myDialog.dPgNo){
        myPgNo.group.orientation = 'column';
        myPgNo.group.alignChildren = 'right';
        myPgNo.group.preferredSize = [90,15];
        myPgNo.group.st  = myPgNo.group.add('statictext',undefined,'Your Doc starting page is:');
        myPgNo.et = myPgNo.add('edittext', undefined, app.activeDocument.pages[0].name)
        btnGroup.btn = btnGroup.add('button', undefined, 'Update');
        btnGroup.alignment = 'right';
    myDialog.dPgNo.btnGroup.btn.onClick = function() {
    myDialog.close();
    var myPagestart = myDialog.dPgNo.myPgNo.et.text;
    if (app.activeDocument.pages[0].name != myPagestart){
    app.activeDocument.pages[0].appliedSection.continueNumbering = false; //<-----------ESTK stops here with the error mentioned before.
    app.activeDocument.pages[0].appliedSection.pageNumberStart = parseInt(myPagestart);
    app.activeDocument.pages[0].appliedSection.sectionPrefix = "";
    alert("Your document start page has been changed to "+myPagestart+".");
    myDialog.show();
    myDialog.show();

    Hi John,
    You don't need to close and reopen the window. Instead of dialog use 'palette' type of the window and run the script in a persistent engine, e.g. #targetengine "session".
    Kasyan
    #targetengine "session"
    var myDialog = new Window('palette','Starting Pg No');
        myDialog.dPgNo = myDialog.add('panel',undefined,'File details');
        myDialog.dPgNo.alignChildren = 'left';
        myDialog.dPgNo.myPgNo = myDialog.dPgNo.add('group');
        myDialog.dPgNo.myPgNo.myGroup = myDialog.dPgNo.myPgNo.add('group');
        myDialog.dPgNo.btnGroup = myDialog.dPgNo.add('group');
        with (myDialog.dPgNo){
            myPgNo.myGroup.orientation = 'column';
            myPgNo.myGroup.alignChildren = 'right';
            myPgNo.myGroup.preferredSize = [90,15];
            myPgNo.myGroup.st  = myPgNo.myGroup.add('statictext',undefined,'Your Doc starting page is:');
            myPgNo.et = myPgNo.add('edittext', undefined, app.activeDocument.pages[0].name)
            btnGroup.btn = btnGroup.add('button', undefined, 'Update');
            btnGroup.alignment = 'right';
    myDialog.show();
    myDialog.dPgNo.btnGroup.btn.onClick = function() {
        var myPagestart = myDialog.dPgNo.myPgNo.et.text;
        if (app.activeDocument.pages[0].name != myPagestart){
            app.activeDocument.pages[0].appliedSection.continueNumbering = false;
            app.activeDocument.pages[0].appliedSection.pageNumberStart = parseInt(myPagestart);
            app.activeDocument.pages[0].appliedSection.sectionPrefix = "";
            alert("Your document start page has been changed to "+myPagestart+".");

  • Palette Design in CS2

    Hi All,
    I am working on the Photoshop CS2 SDK to convert CMYK color space to Gray color  where all photoshop samples are modal dialogs. Is it possible to design non-modal dialog like Palette.If possible where i can get samples?.
    Any advice or samples is much help appreciated.
    Thanks,
    Selvakumar

    No, as explained in the SDK, that is not possible.

  • [JS] Avoid several palettes instanciation

    Hi all,
    I feel so dumb asking for such a silly question but I really can't get this one to work. I have a simple dialog (a palette). Thing is that is user clicks several times, the script outputs many windows. I want to check for a former launched palette.
    I did try everything such a global variable to edit onShow and onClose (isRunning = false), private variables.
    Any hint ?
    #targetengine 'demo'
    var myDialog = (function(){
        var w = new Window('palette');
        return{
            show:function(){
                w.show();
    myDialog.show();
    Option 1: Global variable
    #targetengine 'demo'
    var isRunning = false;
    var myDialog = (function(){
        var w = new Window('palette');
         w.onShow = function(){ isRunning = true; }
         w.onClose = function(){ isRunning = false; }
        return{
            show:function(){
                if(!isRunning) { w.show(); }
    myDialog.show();
    Option 2: private variable:
    #targetengine 'demo'
    var myDialog = (function(){
         var isRunning = false;
        var w = new Window('palette');
         w.onShow = function(){ isRunning = true; }
         w.onClose = function(){ isRunning = false; }
        return{
            show:function(){
                if(!isRunning) { w.show(); }
    myDialog.show();
    I can't get it working so the palette isn't run if done already. I also tried to check for some dialog item existence like in this page but it's not helping : http://kelsocartography.com/scripts/scripts/nvkelso/registrationButtons.jsx
    TIA for any tip. I am certain it's so obvious.
    Loic

    absqua wrote:
    Actually, I guess it's not so weird. You're remaking your myDialog variable at each invocation, so isRunning is false every time. Just adding a check to see if myDialog already exists will prevent it from running two at once:
    #targetengine 'demo'
    var myDialog = myDialog || (function(){
         var isRunning = false;
        var w = new Window('palette');
         w.onShow = function(){ isRunning = true; }
         w.onClose = function(){ isRunning = false; }
        return{
            show:function(){
                if(!isRunning) { w.show(); }
    myDialog.show();
    But, I think you'll have the same problems I showed in my first post with things not working when you run it later in the same session.
    Hi absqua,
    I juts retested and you got it right. I think I had issues with the running sessions. I restarted InDesign several times but probably not in the good tempo. However, now it's working.
    Thanks to Marc too for getting me back to this lead.
    Loic

  • EventListeners in Illustrator CS2

    Hi All,
    I have created eventListeners in InDesign, when i am trying to create in illustrator it doesn't work. What was the problem behind with this.
    Please anyone help me.
    Arivu

    Mark,
    I don't have CS2 installed anywhere to try it, but I don't recall having seen any mention that ScriptUI dialogs and palettes will not work in CS2. You could try running my JET_RandomPatchworkSphere script here as a test.
    JET

  • Why would a control have the customize option dimmed out when it is right clicked?

    A numeric control in one of the examples has the customize option dimmed out when right clicked. Why would that be? Is there a way to get it into the control editor or saved as a control?

    Just to clarify my earlier statement:
    While customization was greyed out prior to LabVIEW 8.0 for items in the dialog (=system) palette, even LabVIEW 8.0+ does not allow much customization. For example if I try to customize the "System Numeric" control, the "wrench" is still greyed out and the only thing I can do is resize the control horizontally in the control editor.
    This is as expected!
    Dialog (system) controls inherit their visual appearance from the OS, and the same control will look different under Windows XP, Windows 2000, or MAC, etc. They adapt to the desktop theme, including fonts, font colors, and other colors, etc.. The attached Image shows the same pair of controls and how they change appearance if I switch the desktop theme between "Windows XP" and "Windows Classic".
    Customization would make no sense, because the appearance is determined by the OS, not by you.
    Message Edited by altenbach on 08-25-2006 02:19 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Theme.png ‏4 KB

  • Alt Text on All States of PSD Button

    For AODA complaince in Canada we need to have alt text on every state of a PSD button, support here wold be ideal as currently the websites are not AODA compliant without this feature.

    This is a bug and not a surprising one. Blinking has always been a hack
    added to LabVIEW for BridgeVIEW and probably never fully integrated
    into the normal object model of LabVIEW objects. As such it has
    frequently broken with new objects such as the Tab Control. You may
    want to report it to NI and hope they get to fix it in LabVIEW 8.0.
    I'm not sure what you guys mean by brushed aluminium. This simply is a
    dialog style control which can't be colored by the developer but will
    attempt to take on whatever are the default colors set in your OS for
    Windows backgrounds. Checkout the dialog Controls palette.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to use Labview 7.0 to make program interface?

    Hellow!
    Will Labview 7.0 be able to make the program interface? just like some application software made by VC++,VB?
    The program interface should have the menu,button,...
    Thanks!

    You can use LV to create a fully working program with an interface of your design, just like you would in any other compiler. LV actually serves as a compiler for a graphical language called G, which is based on dataflow instead of text based execution (the data "flows" through wires from one function to the next, controlling execution order and filling the role of variables).
    Since LV is multiplatform (and not MS), its default controls are not identical to those in VC and VB, but those can be accessed to. Actually, in many ways, it's much easier to build an interface in LV, because building the interface actually defines your "variables" and your interaction with the code.
    An interface would be no good without a program, so you will have to know how to use LV. It's much faster to learn than other languages, but you will still need some experience to write good programs.
    To learn more, I suggest you start by reading the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    If your question was only about MS buttons, like in VB and VC, you can find them in the Dialog Controls palette, or you can use ActiveX to embed them into your program.
    Try to take over the world!

  • Need Help with VI

    Hi LabVIEW Specialists!
    I made a simple VI which should be a gate controller. Ther is on On/Off
    Switch on for opening snd one for closing. Two Leds display the
    direction the gate moves. The gate hase to open until the ensposition
    has reached and then switch to closing until the other endposition has
    reched, and so on. It is allready working pricipally but but if the
    On/Off Button changed to high value it should always open the gate at
    first and thats my Problem.
    Now I'm using a single while loop with two RS flipflops but i don't know
    if this is the best solution. Maybe ist better to use a statemaschine
    or something else. Please take a look at my VI and maybe you can give me
    some hints.
    Link to my VI:
    http://www.8ung.at/mmax/Schubstange.vi
    Thank for y
    our help.
    Max

    You could use an Event Structure and two shift registers to handle opening and closing the gate.
    To make it clearer to me, I renamed the controls to Open and Close, and the indicators to Opened and Closed.
    I interpreted your function as follows.
    If On/Off is Off, ignore other switches and retain previous state.
    If On/Off goes from Off to On, open the gate.
    If On/Off is On and Open goes from Off to On, open the gate.
    If On/Off is On and Close goes from Off to On, close the gate.
    For any other cases, maintain the previous state.
    I also added a Stop button.
    Here's another suggestion: whenever you have a loop waiting for operator input, adding some pause (like 200 ms using the Wait (ms) function from the Time & Dialog function palette) allows the PC to spend
    more time doing other stuff while it's waiting for the user to operate a control. When you use an Event structure, wiring a value to the timeout terminal does pretty much the same thing.
    See the attached modified LabView 7 VI. I noticed that you included a link to your VI instead of attaching it. You can post and see attachments if you get to this forum through www.ni.com and goto the Discussion Forums under Developer Exchange.
    Attachments:
    SchubstangeEvents.vi ‏57 KB

  • InDesign contact sheet  is prompting reject or delete file message box

    Some of us are experiencing a very weird problem in Bridge CS3. When we use the delete button to remove data from the contact sheet settings window (for ex., deleting any data typed into the Template or Output Options fields), the reject/delete files message box appears. I've watched one of my production artists do this, and it's quite odd. All he's doing is selecting a couple or all files in a folder and then creating an InDesign contact sheet. Has anyone else experienced this problem? We were also able to replicate the issue on a different Mac computer. Thanks.

    Lisa,
    When I was writing that script, I chose to make it's dialog a palette rather than a dialog so that the user could modify the selected images while the palette was showing.
    What's happening is that:
    When the delete key is being pressed, the palette to set the settings isn't active (you can tell by the title bar in the window). When it's active, it will receive the delete key event from Bridge, when it's not active, Bridge will process the delete key.
    It seemed like a better way to do it at the time. This was the one bad case I can see, and I never thought about it nor saw it in testing.
    Regards
    Bob

  • Reject vs. Delete on CS3 ACR?

    ACR allows changing the rating (1-5) and deleting (big red 'X'), which it does without any confirmation. However, I cannot find any ability to set the "rating" at 'Reject'.
    Am I missing something or was this added to Bridge, but not to ACR?
    Thanks....JOHN

    Lisa,
    When I was writing that script, I chose to make it's dialog a palette rather than a dialog so that the user could modify the selected images while the palette was showing.
    What's happening is that:
    When the delete key is being pressed, the palette to set the settings isn't active (you can tell by the title bar in the window). When it's active, it will receive the delete key event from Bridge, when it's not active, Bridge will process the delete key.
    It seemed like a better way to do it at the time. This was the one bad case I can see, and I never thought about it nor saw it in testing.
    Regards
    Bob

  • Photoshop & Macbook Retina display

    Does Photoshop support the new Macbook Pro Retina display?

    Chris Cox wrote:
    If the user hasn't changed the OS scaling preferences, then Photoshop on a retina display will look just like Photoshop on a non-retina display.
    It just won't have smooth text and UI edges that the increased resolution offers, and the image won't be using the full resolution of the display because the OS will be doubling all the pixels automatically.
    MacOS on the new machines offers several choices for how to scale applications, including several choices for dealing with apps that don't know about high resolution displays.
    So what your writing is Apple realizes there is a problem running programs written for older low resolution displays. So they have programmed into their OSX system options to scale up application windows to simulate running on a lower resolution device.   Things will appear larger and less sharp then they actually are.  Whoop de do. Why pay for a retina display and not use its resolution. Scaling windows up in size is like using 1/4 the retina pixel for every pixel you display Apple scales it to use 4 of the retina display pixels so the pixels is as large as it would be on a 100dpi display.   Just buy a normal lower resolution and don't have the overhead required to scale windows up to simulate 100dpi to use a 226dpi display as a 100dpi device. Waste of money and resources. Applications like Photoshop need to be changed or run on a 100dpi display.
    Photoshop has no problem with images and high resolution displays.  Photoshop scales image windows content all the time. Its second nature for us to zoom images and pan about them and also change the window size on screen. The only problem there is is that Photoshop can not zoom its Dialogs and Paletts and bars  Photoshop at best offeres one, two or three size options for these and they were designed for displays that have a resolution around 100DPI.  On a 226 or 326 DPI display these areas will be so physically small you will have difficulty reading the small text and making out which small icon your seeing within these areas.
    I find all versions of Photoshop with the exception of CS6 quite useable on my 133DPI displays. The GUI is on the small side. With a magnifying glass or software magnifying glass to see the GUI I would think Photoshop would be useable on a retina display using its native 226Dpi resolution. Its the GUI physical pixel size that is a problem not the 226DPI resolution. If you double the resolution of a display the size of an object becomes 1/4 the size it was on the lower resolution display. If the displays pixel count is not increased the display will be 1/4 the size of the lower resolution display. let get Physical

  • System halt after installation

    Hi,
    i installed Solaris 8 2/02 on an SunFire120. After the installation with the "installation cd" the system rebooted and started the "Web Start Launcher in Command Line Mode". After that he wants to install "Additional Software". The status bar is up to 100% at the beginning and then it seems, that the system halted. You cannot execute any commands oder start a cd. You are not in de OS (no prompt).
    Does anybody have a solution?

    Two suggestion you might try:
    1. Update your video monitor to the latest version.
    2. Put a small delay (around 10 to 100 ms) in all your For and While Loops (including sub VIs). To create a delay, use the the 'Wait' sub VI in the Time & Dialog sub palette. This will force LabVIEW to pause momentarily and let Windows do other stuff....
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • Why did I get error 1122?

    I preapred a program to test something but I get error 1122 when I stopped the program. What is wrong with it?
    Egemen
    Attachments:
    Producer-consumer to txt.png ‏106 KB

    newbieeng wrote:
    How can I do that? I have never done something like that before? How can I detect the code and ignore it? 
    The easiest way is probably to use the the General Error Handler function in the Dialog & Error palette. It has an input that lets you ignore a list of error codes; see the help for details.
    newbieeng wrote:
    Edit: When I change the program as in the attachment, the error message does not pop-up. What is the difference? I do not understand.
    Basic dataflow. The error occurs at the Dequeue function. With your change, the error output from Dequeue stops at the case structure. In your previous code, that error travels all the way to the Simple Error Handler, which is the function that pops up the dialog box. If that's not clear, try running your code with execution highlighting (the light bulb icon in the toolbar) and watch how the error travels along the wires when you push the stop button.

Maybe you are looking for