[JS CS5] problem with memory leak possible with the dialog box in the event handler

Hello

I'm having a very difficult problem.

I am attaching a script in a handler for a menu item, by using an installation script menu that I wrote based on one by Marc Autret. My version of the script menu installation attach a bunch of event handlers at the same time, to the actions of different menu.

What is the event handler, with that I have a problem is to prompt the user for a URL and then applies the URL as a hyperlink to the text selection, with our house style for the way in which the URL should look like.

The problem is the following:

1. all other installed menu actions work very well, except for this one.

2. the addition of URL script works fine, when you run it directly from the script menu.

3. the combination of #1 and #2 (using the script to add URL by function as an event handler in the Edit menu) blocks to InDesign. But it is only after the addition of URL script has finished and done what it was supposed to do!

4. when I comment on the section of the script URL adding user input, so that instead of saying

userInput = myDisplayDialog();

It is said

userInput = "http://thisworks.com";   // userInput = myDisplayDialog();

It works well as an event handler.

So obviously a problem with the dialog box, but only when adding URL script is executed as an event handler. My first guess is that this is some kind of memory leak, but I think I am following the model of. destroy() the way I saw it elsewhere.

Someone knows something like that before?

I can provide all relevant if necessary scripts, but they are quite complicated. The most important of them is the input of the user function. Here it is:

var myDisplayDialog = function( defaultText ) {
  
    var defaultText = defaultText || "";
    
    var myDialog = app.dialogs.add({
        name: "Type in a URL"
    });
    
    var myOuterColumns = [];
    var myInnerColumns = [];
    var myOuterRows = [];
    var myBorderPanels = [];
    var myTextEditboxes = [];
    var myInput;
    
    myOuterColumns[0] = myDialog.dialogColumns.add();
    myOuterRows[0] = myOuterColumns[0].dialogRows.add();


    myBorderPanels[0] = myOuterRows[0].borderPanels.add();
    myInnerColumns[0] = myBorderPanels[0].dialogColumns.add();
    myInnerColumns[0].staticTexts.add({
        staticLabel: "URL:"
    });
    
    myInnerColumns[1] = myBorderPanels[0].dialogColumns.add();
        
    myTextEditboxes[0] = myInnerColumns[1].textEditboxes.add({
         minWidth: 300,
         editContents: defaultText ? defaultText : "http://"
    });
    
    var myResult = myDialog.show();
    var myInput = myTextEditboxes[0].editContents;
    
    myDialog.destroy();

    if (myResult == false) {
          exit();
    }
    
    return myInput;

}

Hi Richard,

Unfortunately, there is no guarantee that the ScriptUI longer work.

Thake a peek here: http://forums.adobe.com/message/2881364

--

Marijan (tomaxxi)

http://tomaxxi.com

Tags: InDesign

Similar Questions

  • Problem with the event

    Hello
    I am facing a problem with the events. Please Ref. Event.zip the attachment.

    AEv.vi is a LV2G used for the reading/Generate/Init/destroy the event. Test2.VI is a main vi (we must run this vi)

    The AEv.vi Init action must be done in the other vi (other than the Test2.vi:- but for the objective test I've initialized in Test2.vi only).

    Test2.VI is used for genetate event.

    I could have called statically AEv.vi inside the Test2.vi to generate an event... but the path that comes is decided when running... (I have many live similar to AEv.vi...) .. who decided at run time...)

    The problem:

    When I run Test2.vi, it gives me the error code 1 (try running test2.VI... it gives the dialogue on the occurrence of the error)...

    Can someone fix this?

    Thank you!

    I modified your screws to do what I think you want.  The way you did the user events will not work.  I added a line to send orders to Ev.vi

  • Help with the event handler.

    Hello
    We had two adapters entity IOM 10 g that fires when the user group memberships are changed. He was attached to the User Groups.User Members post insert and delete data object after.
    To have the same functionality in OIM 11 g, we try to create the event handler.

    I have doubts in this regard.
    1. how the event handler will fire in 11 g on change of group.
    2. we have event handlers that are registered using Ant plugin to check utility. Now, if I want to join this newly created event handler, do I need to implement the new code already a create a new pot and re-save the plugin or can we have several plugin.zip file.

    Thank you

    concerning
    Stone

    steps below:

    prepare the pot for the class as in 10g-> put the server (anywhere) IOM-> goto /Server/bin/now run below
    UploadJars.sh

    Select as a scheduled task
    provide the absolute path with name of the jar.
    If credentials requested provide IOM credential (xelsysadm)

    Once the pot is downloaded to remove the file system. subsequently if necessary change to use UpdateJars.sh instead of UploadJars.sh
    Once you do this PurgeCache.sh performance as well

    --

  • CS5 problems with the alignment of the object key?

    I use guides like objects for alignment keys without problem in CS4 for Mac, but just objects in CS5 fly somewhere not visible anywhere in the file. I checked prefs but sees nothing that would create this behavior, and alignment on the pixel grid doesn't seem to matter. Still works fine in CS4. I could draw a line to line up to as a work-around, but it would be tedious. Aligning to the selection and the artboard work properly. Anyone else noticed this or know what could be the cause of this? Thanks in advance for your help.

    Have you had this problem from the beginning, or it appears suddenly? I saw this problem in CS3, set by trashing the settings folder.

    Peter

  • Small problem with the events of the listener

    I have a small interface with 5 radio buttons and a buttonfield and when i click buttonfield I create an event. all this works fine, but when I want to go back to the previous page I see pop up with 3 had to 'save, ignore, reject' and when I click on one of them I create a duplicate of the trial before.

    How can I go to the previous page without showing the pop-up with 3 coiches and without creating duplicate event?

    It's the listener code

    FieldChangeListener listener = new FieldChangeListener() {}
          
    ' Public Sub fieldChanged (field field, int context) {}
     
    {if (delivery. IsSelected())}
                               
    Time zone tz = TimeZone.getTimeZone ("GMT"); We want the time gmt
    Calendar gc = Calendar.getInstance (tz);  It gives the time date and gmt
                     
    int ore = gc.get (Calendar.HOUR_OF_DAY);
    int min = gc.get (Calendar.MINUTE);
    s int = gc.get (Calendar.SECOND);
                     
    Co co = new coordinate (longitude, latitude, ore, min, sec, 9, "Delivered");
    CoorVect.addElement (co);
    Dialog.Inform ("send event");
                       
    } else {}
    {if (GuastoMeccanico.IsSelected ())}

    Time zone tz = TimeZone.getTimeZone ("GMT"); We want the time gmt
    Calendar gc = Calendar.getInstance (tz);  It gives the time date and gmt
                         
    int ore = gc.get (Calendar.HOUR_OF_DAY);
    int min = gc.get (Calendar.MINUTE);
    s int = gc.get (Calendar.SECOND);
                         
    Co co = new coordinate (longitude, latitude, ore, min, sec, 9, "Guasto Meccanico");
    CoorVect.addElement (co);
    Dialog.Inform ("send event");

    } else {}
    {if (IncidenteStradale.IsSelected ())}

    Time zone tz = TimeZone.getTimeZone ("GMT"); We want the time gmt
    Calendar gc = Calendar.getInstance (tz);  It gives the time date and gmt
                          
    int ore = gc.get (Calendar.HOUR_OF_DAY);
    int min = gc.get (Calendar.MINUTE);
    s int = gc.get (Calendar.SECOND);
                          
    Co co = new coordinate (longitude, latitude, ore, min, sec, 9, "Incident Stradale");
    CoorVect.addElement (co);
    Dialog.Inform ("send event");

    } else {}
    {if (LavoriInCorso.IsSelected ())}
                             
    Time zone tz = TimeZone.getTimeZone ("GMT"); We want the time gmt
    Calendar gc = Calendar.getInstance (tz);  It gives the time date and gmt
                           
    int ore = gc.get (Calendar.HOUR_OF_DAY);
    int min = gc.get (Calendar.MINUTE);
    s int = gc.get (Calendar.SECOND);
                           
    Co co = new coordinate (longitude, latitude, ore, min, sec, 9, "Works in Corso");
    CoorVect.addElement (co);
    Dialog.Inform ("send event");
    } else {}
    {if (SenzaConsegna.IsSelected ())}
                                          
    Time zone tz = TimeZone.getTimeZone ("GMT"); We want the time gmt
    Calendar gc = Calendar.getInstance (tz);  It gives the time date and gmt
                            
    int ore = gc.get (Calendar.HOUR_OF_DAY);
    int min = gc.get (Calendar.MINUTE);
    s int = gc.get (Calendar.SECOND);
                            
    Co co = new coordinate (longitude, latitude, ore, min, sec, 9, "Not delivered");
    CoorVect.addElement (co);
    Dialog.Inform ("send event");

    } else {}
    Dialog.Inform ("Nessun elemento indication!");
    }
    }
    }
    }
    }
    }
    };

    Added on-screen, this code will replace the popup screen.

    I don't understand the second part of the question, that is to say the second invent.  Add this code and make sure that the popup is removed and then tell us if all your problems are solved.

    Also search the doc for this method in the object Screen to understand how it works.

    /*
    * Override to ignore the save/discard/Cancel dialog box
    */
    public boolean onSavePrompt() {}
    Returns true;
    }

  • Problem with the events and Movieclips

    Hi all.

    I got myself in a situation where everything was perfect with zoom events, keyboard events and drag-, click of the mouse.

    The project is:

    A movieclip with image sequence: original background.

    And other clips: also images sequence (png)

    They were all separate specific mouse events and all the zoom and key events.

    Now wen I click on the button with the movieclip to function, only the png image sequence is turning and the main mc is not.

    What should I do to rotate active both regardless of the mcs and main mc also png with these.

    Help, please.

    Thank you in advance.

    use:

    var mcA:Array = [garage_horizon_mc, garage_moss_mc, garage_ocean_mc, gutter_ocean_mc, gutter_horizon_mc, Audrey r_moss_mc, main_mc];

    for (var i: int = 0; i<>

    mcA [i] .addEventListener (MouseEvent.CLICK, garageF);

    }

    function garageF(e:MouseEvent):void {}

    for (var i: int = 0; i<>

    mcA [i] .visible = false;

    }

    var mc:MovieClip = MovieClip (e.currentTarget);

    mc.gotoAndStop (rotationframe);

    MC. Visible = true;

    whateverF (mc);

    }

    function whateverF(rotater_gah:MovieClip):void {}

    rotater_gah.offsetFrame_gah = rotater_gah.currentFrame;

    rotater_gah.offsetX_gah = 0;

    rotater_gah.percent_gah = 0;

    rotater_gah.addEventListener (MouseEvent.MOUSE_DOWN, startDragging_gah);

    rotater_gah.addEventListener (MouseEvent.MOUSE_UP, stopDragging_gah);

    }

    function startDragging_gah(e:MouseEvent):void {}

    e.currentTarget.addEventListener (MouseEvent.MOUSE_MOVE, drag_gah);

    e.currentTarget.offsetX_gah = e.target.mouseX;

    }

    function stopDragging_gah(e:MouseEvent):void {}

    e.currentTarget.removeEventListener (MouseEvent.MOUSE_MOVE, drag_gah);

    e.currentTarget.offsetFrame_gah = rotater_gah.currentFrame;

    }

    function drag_gah(e:MouseEvent):void {}

    e.currentTarget.percent_gah = (e.target.mouseX - e.currentTarget.offsetX_gah)/e.currentTarget.width;)

    var frame_gah:int = Math.round(e.currentTarget.percent_gah*e.currentTarget.totalFrames) + e.currentTarget.offsetFrame_gah + 1;

    While {(frame_gah>e.currentTarget.totalFrames)}

    frame_gah = e.currentTarget.totalFrames;

    }

    While (frame_gah<=0)>

    frame_gah += e.currentTarget.totalFrames;

    }

    e.currentTarget.gotoAndStop (frame_gah);

    }

  • Problem with the event and the case of Structure

    Hi all,

    I get the problem in my program, I'm using the two structure one is the same and other structure box.

    In the structure of the case, I had the button as an entry to the SPL and the case structure as the output of the structure of the case.

    And in the same, then I had the two text box (num control A and B) in that I had put the event changes its value. Then, even I put the value has

    num or num B control control control this corrosponding num value will save seeing num C. Now the problem is when I click on

    the theLEB button does not blink until or if you don't put the value of one of the corrosponding num control.i didn't post my file in version 8.5 and 8.6 Please find tha.

    Hello

    It should work like that or I misunderstood what you want to do.

    If Boolean is true, boolean 2 is true, at the same time, you can change the value of A so C or B then C.

    See attachment

  • Problem with custom dialog box

    I have a custom dialog box. The code goes here

    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    public class CustomDialog extends Dialog{
    
        public CustomDialog(int command,String msg,int color,int alpha){
             super(command, msg, command,Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), VerticalFieldManager.FOCUSABLE);
             setBackground (BackgroundFactory.createSolidTransparentBackground (color, alpha));
        }
    
    }
    

    I'm the caller to another class as follows

    CustomDialog d = new CustomDialog(Utils.D_YES_NO,"Do you want to exit",Color.BLUE,140);
    d.show();
    

    Its display very well and as I intended it to be. But the problem is that I'm not able to get the index of the choice to perform certain actions, such as

        int i=d.getSelectedValue();
    
                        if(i==Dialog.D_YES){
                            Dialog.alert("hi");
                        }
    
                        }
    

    Its do not call the dialog box, can anyone suggest me how to get the index of the choice that I chose to say YES or NO and to perform tasks accordingly

    Plese try suite

    CustomDialog d = new CustomDialog(Dialog.D_YES_NO,"Do you want to exit",Color.BLUE,140);
                    d.show();
                    d.setDialogClosedListener(new DialogClosedListener() {
    
                        public void dialogClosed(Dialog dialog, int choice) {
                            /*
                             *   // Field descriptor #211 I
                                  public static final int YES = 4;
    
                                  // Field descriptor #211 I
                                  public static final int NO = -1;
                             */
                            int i=choice;
                            System.out.print("Selected Value :"+choice);
                            if(Dialog.YES==choice){
                                System.out.println("Selected Value : YES");
                            }else if(Dialog.NO==choice){
                                System.out.println("Selected Value: NO");
                            }
    
                        }
                    });
    

    If it is useful, please make as response and do not hesitate on LIKE button thanks

  • Problems with the generator of Folio for CS5 (Mac)

    Hello

    I run Adobe CS5 Suite. I am currently developing an iPad app and run into a problem with the generator of folio. Previously, this computer doesn't have a generator all of folio. I followed the instructions on adobe.com and downloaded and installed the update producer folio tools (http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5433 & starts = 5435) and then downloaded and installed the updated folio builder Panel (http://www.adobe.com/support/downloads/product.jsp?product=180 & platform = Macintosh). When I open inDesign, generator of folio is still saying "an update Is had to use Folio Builder."  "Please click here to download the producer Folio tools."

    I don't know why this is happening because I have already downloaded the new tools producer, by following these instructions: http://help.Adobe.com/en_US/digitalpubsuite/using/WS67cb9e293e2f1f60-21ba9a4512e5e5e0b8d-7 ffe.html

    Anyone have any suggestions on how to fix this? Please let me know as soon as possible.

    Thank you very much for your help!

    Try the following steps:

    1. on your mac, go to the Spotlight, search > uninstall Folio builder control panel - uninstall, uninstall producer Folio tools research - uninstall.

    2 then uninstall Adobe Air.

    3. restart your Mac.

    4. install Adobe Air

    5 re-install the Folio and tools Panel generator producer Folio.

  • I have an iMac7, 1 with Intel Core 2 Duo 2.8 GHz, 2 GB memory, 500 GB storage, iOS10.6.8 and can update in 10.11.2.  must I do cela or are there problems with the upgrade?

    I have an iMac7, 1 with Intel Core 2 Duo 2.8 GHz, 2 GB memory, 500 GB storage, iOS10.6.8 and can update in 10.11.2.  must I do cela or are there problems with the upgrade?

    I don't know about other issues. There are always 'problems' with any upgrade. You weigh against the benefits. I know that you need more RAM. At least 4 GB, maybe more if you can. Don't forget that this system is produced at a time when most of the machines have + 8 GB RAM and when Apple said 'minimum' they really mean it.  I recently inherited a MacBook that has 2 GB of RAM and the Mavericks. When I checked the memory, the use of the system was using 1.95 GB = nothing to run applications!

  • I bought for the Adobe Master Costume CS5.5 product packaging a few years back and today I get the following message appears: "Configuration Error: there was a problem with the license of this product." You restart the computer and restart production

    I bought the Adobe Master Costume CS5.5 product packaging a few years back and today I get the following message appears: "Configuration Error: there was a problem with the license of this product." You restart the computer, and restart the product. Error 213:19 ".

    That was before Adobe moved to a payment structure based on participants. I need to be able to access these programs. Please provide a solution to the problem.

    order to C:\ProgramData\Adobe & C:\ProgramData\Adobe\SLStore folders full reapply administrators property back on the C:\ProgramData folder and then add everyone.

  • I have Photoshop CS5.1 Extended with free upgrade to CS6. How do I re acquire this upgrade?  I upgraded my laptop from Vista to Windows 7 and had problems with the way he ran I did a full clean install of Win 7 and am trying to re install all my

    I have Photoshop CS5.1 Extended with free upgrade to CS6. How do I re acquire this upgrade?  I upgraded my laptop from Vista to Windows 7 and had problems with the way he ran I did a full clean install of Win 7 and am trying to re install all my Applications

    Please refer to I have Photoshop CS5.1 Extended with free upgrade to CS6. How do I re acquire this upgrade?  I upgraded my laptop from Vista to Windows 7 and had problems with the way he ran I did a full clean install of Win 7 and am trying to re install all my

    (Double Post)

  • I have Photoshop CS6 and Lightroom 5.7. They are currently installed on a PC with Windows 8.1 Professional 32-bit and 4 GB of RAM. I want to move to a PC with Windows 8.1 Professional 64 bit and 32 GB of memory, because I have a problem with the large

    I have Photoshop CS6 and Lightroom 5.7. They are currently installed on a PC with Windows 8.1 Professional 32-bit and 4 GB of RAM. I want to move to a PC with Windows 8.1 Professional 64 bit and 32 GB of memory, because I have a problem with the large RAW from a Canon 5 Ds R. What should I do?

    You install exactly in the same way you did the 1st time... Put your disc in the drive, and enter your serial number when asked

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a link to access a page to download the Adobe programs if you do not have a disk or drive

    Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq

  • Problems with the Panel tabs with CS5, CC2014, CC2015?

    I created a script with TabbedPanel in ESTK CC, works very well in afx CC 2014, but it seems that there are some problems with the other versions (CS5 and CC2015).

    Can someone help how to generalize the limits and the tabs?

    Here is my Code briefly for the tabs.

    //

    //

    //

    function buildUI (thisObj) {}

    var myPanel = (thisObj instanceof Panel)? thisObj: new window ('pallet', 'Gear of Stress', undefined, {resizable: true});

    myPanel.timeSavers = myPanel.add ('tabbedpanel', [0,0,400,300], "Reducing Stress V1'");

    myPanel.timeSavers.cProject_tab = myPanel.timeSavers.add ("tab", undefined, 'Project');

    myPanel.timeSavers.MyTools_tab = myPanel.timeSavers.add ('tab', undefined, 'MyTools');

    myPanel.timeSavers.Explorer = myPanel.timeSavers.add ("tab", undefined, 'Explore');

    myPanel.timeSavers.Others_tab = myPanel.timeSavers.add ("tab", undefined, "Install");

    Return myPanel;

    }

    var myToolsPanel = buildUI (this);

    //

    //

    //

    Below the results to remain CS5, CC2014, CC2015. How to promote the universalization of the buttons, tabs, alignments etc as in CC2014 in other versions. Someone please help?

    afx cs5.pngafx cc 2014.pngafx cc 2015.png

    Don't you think that the resource string could solve this problem?

    You can certainly try a resource string. I used only once I understood how they worked, I find it much easier to build a UI in this way.

    myPanel.layout.layout (true);  Tried it, but all child elements arranged in a line or column that's it, do not respect the limits specified.

    To a resource string, make sure that every single container element specified margins or spacing info. If they do not have this set the automatic layout manager will just default to each calibration of control internal specifications, which vary with each version of AE.

    How can I universalize the user interface for all versions of EI? While I'll change once and for all.

    There is no miracle solution for all versions of AE to play nice with your construction. You to beta-test your code in each version of the EA you want your script to run on and then unique questions individually. Your script should contain a checker version AE, so you can know what patches, you need to implement when the user runs the script. It is not ideal and is one of the many oddities of software development based on the API of someone else.

  • I have a problem with the CS5 updates

    Hello

    I have problems with the update of my CS5. I get an error message "there was an error downloading this update. Quit and try again later.

    Can you please help?

    Thank you

    Eli B

    See if doing manually works

    All the early updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

Maybe you are looking for

  • effect of iMessage

    effects of IMessage are there more that what is said? r there hidden effect that are not human beings humans taught? Could some one adbice if they know what other tricks iMessage. Thanks 1million

  • E-mail rule does not always work.

    I have attached a copy of this message and the State which must have managed to get rid of it. If I change the rule and apply it, it works, but tomorrow if I get a similar message, the rule does not work. What's wrong? Thank you, Fred

  • Satellite C660 - 21Q does not start

    Hi guys, new to this forum so bare with me! I dropped my laptop last week, on his side. Now when I turn on, it's on a black screen with the white light flashing on the upper left side. After a while, the "Toshiba" loading screen lights up (where you

  • Only use as a wifi device

    I have a Droid 4 that will not let me restart it without a neat sim. I want to only use it as a wifi device, especially when I'm banging long emails etc. How to past the screen that says "do not use this device without a sim card?

  • the desktop icons do not open by clicking

    recently, I am facing a problem with the icons on the desktop.  . the high hangse of the page upward desktop icons and can not access any program from its shortcut on the desktop. then happensafter I use the computer for an hour or two