JS: Persistent Modeless Dialog

I am trying to make a modeless dialog box for InDesign, but for some reason the dialog always closes after the script runs (i.e. I see the dialog for a brief second until the script finishes running, then it's gone). I cannot get it to persist. I need to be able to edit a document while the dialog is open. Any suggestions?
I am using the ScriptUI classes to create a dialog with the property 'palette'.

I tried that, still the same. I can put that at the beginning of the script, right? Along with my application target?
Example:
#target InDesign
#targetengine "session"
Here is my whole script (don't laugh too hard, I am still trying to figure this out ):
#target InDesign
#targetengine "session"
function closeWindow(){
     posWin.close();
var posWin = new Window(
     'palette',
     'Position the Image',
     undefined, {
          resizable: false,
          closeButton: true,
          maximizeButton: false,
          minimizeButton: false,
          independent: false,
          borderless: true
posWin.location = [0, 0];
posWin.info = posWin.add('panel', undefined, undefined);
posWin.action = posWin.add('panel', undefined, undefined);
posWin.action.orientation = 'row';
posWin.action.prevMaterialBtn = posWin.action.add('button', undefined, '<-- Previous Material');
posWin.action.cancelBtn = posWin.action.add('button', undefined, 'Cancel');
posWin.action.cancelBtn.onClick = closeWindow;
posWin.action.nextMaterialBtn = posWin.action.add('button', undefined, 'Next Material -->');
// This function will call an instance of a template, delete the link to the current photo, replace it with a new photo and then wait for an onClick (or some other) event.
// It will then write the information to the XMP, close the template and open the next template.
posWin.show();

Similar Messages

  • Modeless Dialog Box Not Displaying Contents

    I have created a simple modeless dialog box. Although the dialog box and title appear, the contents (a label) do not appear. The dialog box does display correctly if the dialog box is switched to a modal box.
    I got into this problem because I also cannot get labels to change after their initial display on the main frame. I've tried repaint() and Thread.sleep().
    Please help me, I am a newbie to Java.
    Sincerely,
    John

    I actually had a similar problem with a JDialog containing only a progress bar, which ended up being a problem with Swing rather than my code (the bug report has already been filed). Adding a second component to the dialog fixed the problem, counterintuitive as that seems. Try it and see if that helps... If the label is a JLabel, you might try calling revalidate() on it to get the text to update.
    Ian

  • Help !modeless  dialog in acrobat 9.0

    I want to know how to create a modeless dialog in acrobat 9.0 PRO?   ADM has already been removed from the acrobat 9.0? According to  the javascript reference,i can only create modal dialog boxes.help!thanks

    You can't. As you read, JS dialog windows in Acrobat are modal.
    However, what you can do is pass a reference to the document object to the dialog, and then manipulate it there. It's not exactly the same as having a modal-less window (since the user can't interact with the document directly), but it's better than nothing...

  • Modeless dialogs and the active document

    I have a modeless dialog (Qt) that contains a checkbox to toggle off and on annotations that our plugin draws.  When the user clicks the checkbox, it calls a function in the plugin code that ultimately makes a call to AIAnnotator->SetAnnotatorActive().  When passing in false, the annotations stop drawing, as expected.  But when passing in true, the annotations don't draw (the plugin doesn't even get the kCallerAIAnnotation message) until the modeless dialog moves or the Illustrator window gets focus.
    I have tried to force a redraw and a bunch of other things to try to get the annotations to start drawing, but none of them work.  One thing I found interesting (and is the root of the problem, I suppose) is that at the point the user clicks the checkbox in the modeless dialog, making a call to AIDocument->GetDocument() returns DOC?, which means there isn't an active document.  Without an active document, none of the calls to redraw the window or invalidate the current view will work.
    Have any of you experienced this before and come up with a solution?  I'm really at a loss on what to do.

    Thanks for the response.
    Maybe I'm not calling the AIAppContextSuite functions at the correct time, but they don't seem to do anything in this situation.  I'm pushing the context right before I display the Qt dialog (at which point I have a document and a view), but when the checkbox is clicked, calling AIDocument->GetDocument still indicates there isn't a document.  These click events happen in the Qt event thread, not the plug-in message thread, but I don't believe the click itself is the problem.

  • Whatever happened to Alt+F6 (to switch between modeless dialogs)?

    In all versions of Windows until Vista (I think that was when it went
    missing) you used to be able to press the standard defined accelerator
    Alt+F6 to switch between an application's main window and any modeless
    dialogs it had.
    It's still documented as such here:
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb246447(v=vs.85).aspx
    "ALT+F6
     Switch to next window within application (between modeless secondary
    windows and their primary window).
    For example, in Notepad, when you have its Find dialog open, under
    XP/Windows 2003 (and all earlier Windows versions) you can press
    Alt+F6 to switch between the main window and the Find dialog.
    This keystroke was particularly useful when an application's modeless
    dialog was positioned off the screen and couldn't be clicked on it
    with the mouse. You could press Alt+F6 to activate the modeless
    dialog, then Alt+Space to popup the modeless dialog's menu, then
    invoke the move operation - and get the modeless dialog back on
    screen.
    On all versions of Windows subsequent to XP/W2K3, as far as I know
    there's no way of activating a modeless dialog with the keyboard.
    Does anyone know if there's a substitute keystroke, and if not, out of
    interest why we lost that keystroke?
    Dave

    Are you using KMS?
    I'm not sure but you could try launching your WM from .xinitrc:
    'exec ck-launch-session WM'
    Instead of WM you can try 'startxfce4' 'xfce' or wait for somebody smarter than me :-)

  • How to create a modeless dialog using commandlink

    i want to create a modelessdialog using commandlink. and my code is
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <f:view>
    <script language="Javascript1.2">
    function modelesswin(){
    window.showModelessDialog();
    </script>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <h:form>
    <h:commandLink onclick="javascript:modelesswin('popup.html', 300, 300)" value="click"></h:commandLink>
    </h:form>
    </body>
    </f:view>
    </html>
    when i click the buttonlink the dialog box is not in a stable state that is its will appear and within a second it will disappear .. can any one of them can suggest me how to create a modeless dialoge using commandlink or by jsf option button
    regards
    subramanian

    If I had to guess (and I do :), the onclick is firing, bring up the dialog, but the commandLink causes a form submit, so the page is submitted. There is no action on the commandLink, so it's navigating back to the same page, causing it to refresh and your dialog to disappear. It would appear to me that you need a h:outputLink or simply <a href="# onclick="..." /"></a>

  • ScriptUI tab through the fields in a modeless dialog (IDCS4ME)

    Hi,
    I've made a dialog with ScriptUI, a "palette" i.e., modeless. I'd like the user to be able to press the Tab key and shift through the various text input fields etc. But instead, the Tab key hides the InDesign panels even when the dialog has the focus.
    Anyone know how I can get the Tab key to work in a standard way?
    Thanks,
    Ariel

    Thanks Harbs
    Is this the same bug that when typing characters they sometimes are applied to the InDesign document, and sometimes to the dialog?
    If so, does this mean that essentially nobody uses modeless dialogs with ScriptUI on a PC?

  • Modeless dialogs

    Hi,
    I am developing under Windows XP, SP2, all updates installed. When I run the program below, the modeless dialog disappears after a few seconds when I click into the parent frame. Obviously the frame repaints and ignores the dialog. But the dialog is still in front of the frame. If you click somewhere in the frame, where the dialog had been shown, the title bar of the dialog reappears. This happens under JRE 1.6.0_03.
    If I run under JRE 1.5.0_14, the dialog stays in front visibly, but the frame is also repainted after a click (focus change). This can be noticed because the screen flickers.
    Does somebody have a workaround for JRE 1.6.0_3?
    Thank you
    Jochen
    Here the code:
    package divtest;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Point;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    public class ModelessDialogTest extends JFrame {
      public ModelessDialogTest() {
        super("ModelessDialogTest Frame");
        setSize(800, 600);
        setVisible(true);
        Container contentPane = getContentPane();
        contentPane.setBackground(Color.red);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JDialog md = new JDialog(this, "ModelessDialog", false);
        md.getContentPane().setBackground(Color.yellow);
        md.setSize(200,150);
              Dimension parentSize = getSize();
              Dimension mdSize = md.getSize();
              Point parentLoc = getLocation();
              parentLoc.x += (parentSize.width - mdSize.width) / 2;
              parentLoc.y += (parentSize.height - mdSize.height) / 3;
              md.setLocation(parentLoc);
        md.setVisible(true);
      public static void main(String args[]) {
        ModelessDialogTest mdt = new ModelessDialogTest();
    }

    Bogdan wrote:
    > I'm trying to make a modeless window that will open the mails of a
    > specific message class. The problem is, that GroupWise traps some
    > keyboard events that will never make it to my modeless window. So far
    > I'm using modal windows, but that's an issue.
    >
    > I read this in the c3po documentation:
    > "Modeless dialog boxes are best implemented in an out-of-process server.
    > Because GroupWise traps keyboard events (to turn them into accelerators
    > and eventually into tokens), a .DLL server will experience problems
    > receiving keyboard events when creating a modeless dialog box or window."
    >
    > So, the question is, how do I do that in C#?
    Found a solution myself.
    I used
    System.Windows.Forms.Application.Run(new MyForm());
    instead of
    Form frm = new MyForm();
    frm.Show();

  • Can i create ADM Modeless dialog using Photoshop CS5 SDK

    Hi,
    I am developing a photoshop plugin using CS3 SDK. I am using ADM to create dialogs. Developing ADM Modeless dialog is not possible in CS3 SDK.
    Can any one please tell me whether it is possible in CS5 SDK to create Modeless dialog. ( So that user of my plugin will be free to use photoshop even after invocation of DialogBox. )
    If Modeless dialogs are not possible in photoshop using ADM,..... Is ther any other way to create modeless dialogs in photoshop ??
    Regards,
    Prafulla Vedante

    ADM Modeless dialog is not supported in Photoshop in any version.
    Your only option to make a panel / palette in Photoshop is to use the CS SDK (CS5) or the "Photoshop Panel Developer's Guide" ( CS4 or CS5 ).
    http://www.adobe.com/devnet/photoshop.html
    http://blogs.adobe.com/cssdk/tag/cs-sdk

  • How to create modeless dialog?

    Hi,
    Any body tell me how to create the modeless dialog??

    From your y'day's post...
    See to the VI Properties for what I ve changed.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    MainVI.vi ‏18 KB
    SubVI.vi ‏12 KB

  • Modeless dialog on top

    How can I force a modeless dialog to be always on top of its owner?
    Thanks

    It doesn't for me: public class testtttttt extends JFrame implements ActionListener{
         public testtttttt(String arg0) throws HeadlessException {
              super(arg0);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public static void main(String[] args) {
                        testtttttt t = new testtttttt("icon");
                        JPanel p = new JPanel();
                        p.setSize(100,100);
                        JButton b = new JButton("open");
                        b.setPreferredSize(new Dimension(80,25));
                        b.addActionListener(t);
                        p.add(b);
                        t.getContentPane().add(p);
                        t.pack();
                        t.show();
         public void actionPerformed(ActionEvent arg0) {
              Dia d = new Dia(this,"Modal");
              d.setModal(true);
              d.pack();
              d.show();
    public class Dia extends JDialog implements ActionListener{
         public Dia(Frame arg0, String arg1) throws HeadlessException {
              super(arg0, arg1);
              JPanel p = new JPanel();
              JButton b = new JButton("open");
              b.addActionListener(this);
              p.add(b);
              getContentPane().add(p);
         public void actionPerformed(ActionEvent arg0) {
              Dia d = new Dia((Frame)this.getOwner(),"Help");
              JPanel p = new JPanel();
              JTextField f = new JTextField();
              f.setPreferredSize(new Dimension(60,20));
              p.add(f);
              d.getContentPane().add(p);
              d.pack();
              d.show();
    }

  • Click To Activate issue with modeless dialog popup..

    I have a customer that is having the annoying "click to activate control" for applets in IE.    I've been able to fix it for thier normal pages with a fix I found on the internet (why re-invent the wheel right? ) , however they have a few "pop up" windows where they use the  "window.showModelessDialog"  method of opening a new window.    For this window, my usual fix doesn't work...
    I have a feeling that it has to do with opening the window as a modeless diaglog.    Any ideas?
    EDIT
    I realize that this problem will go away in April of 08.  However a significant number of clients machines will not be updated anytime soon (as they are not connected to the internet)
    Edited by: Doug Holtke on Jan 24, 2008 6:50 PM

    Doug,
    You can remove the Windows update that put the lock on the active objects in the first place.  I don't know the patch number off hand but I'm sure you can find it.
    Sam

  • Persistent ScriptUI Dialogs that can be shown several times.

    Hi all,
    I love ScriptUI and all its possibilities. But every time I try something new I fail for at least some days
    Here is my newest conundrum: I try to do something that involves selecting a menu item along the road. Assembling all menu items in a tree view takes up to 20 seconds so I would like to build that dialog only once and call it repeatedly from the main dialog.
    The test setup illustrates the problem:
    var w = new Window("dialog");
    var d = new Window("dialog");
    d.closeDlg = d.add("button", undefined, "Close Dialog");
    d.closeDlg.onClick = function () {
         d.hide();
    w.openDlg = w.add("button", undefined, "Open Dialog");
    w.cancelElement = w.add("button", undefined, "Cancel");
    w.openDlg.onClick = function () {
         d.show();
    w.show();
    The first click on "Open Dialog" looks as it should. But when you cancel d and click again, the sub dialog contains nothing and is off the screen.
    I can correct the latter (d.center() before d.show() ), but not the former.
    Help says "When a window or container is hidden, its children are also hidden, but when it is shown again, the children retain their own visibility states."
    I tried to show the children in a d.onShow() function but so far with no success.
    So my question is (thank you for reading this far):
    Can this be done? Can I build a complicated dialog once and call it several times from a different dialog?
    The only other option I can think of is to build an ugly super-dialog that contains all the controls of the main and of the sub dialog. bah.
    Thank you
    Gerald

    Duh...
    Peter I feel stupid. Of course. Thank you for pointing that out to me
    I updated the zip in the mentioned post, in case anyone's interested.
    Harbs, I save a lot of details in the list items themselves instead of maintaining an additional array. So removing all listitems would mean I lose e.g. the info which menu item is applied to which script.
    So rebuilding the list would mean quite some changing of my datamodels. I will keep that in mind for future projects, though. Thank you
    Gerald

  • Some progress on modeless dialogs...

    Hi all,
    The last couple of weeks I've been trying to get floating tool windows into photoshop. I'm trying a lot of things and came across this:
    Load up the "FrameSelect" example project and change the DoUI() function to this:
    SPErr DoUI ()
    SPErr error = noErr;
    //int item = kDNoUI; // Error value.
    SaveParameters(); // Save our parameters, just in case.
    if (sADMDialog != NULL)
    sADMDialog->Create
    gPlugInRef,
    "FrameSelection",
    kDialogID,
    kADMTabbedFloatingDialogStyle,
    DoUIInit,
    NULL, /* No user data */
    0//InOptions = 0
    //if (item != kDOk_button)
    // error = 'STOP'; //'STOP' = kUserCancel;
    // RestoreParameters();
    return error;
    The sADMDialog->Create functon replaces the sADMDialog->Modal function that was there. This is all in the standard PS SDK, just had to go hunting through some header files. When yo run this code you sort of have a floating tabbed tool window. There are still some odd thing that happen but this might get some people on the right track.
    G

    Trash CoreCenter, and disable CPU Fan Target in BIOS. Cool 'n Quiet I don't use either. Then you may be able to resolve this much easier!

  • Dialog box display won't update after screen blank or being moved

    I have a modeless dialog box used for status display by a plugin I wrote for Acrobat. Everything works fine until the screen blanks or the user moves the dialog box on the screen, at which point no further updates to the dialog box are displayed. My plugin consumes 100% of CPU for long periods of time so the program can appear dead without this display being updated, but nothing I have tried seems to make any difference. The dialog box is generated with ADM and things I have tried include calling "Update" on the dialog box at regular intervals, the windows "Sleep" function to yield the CPU periodically, and a host of similar tactics.
    I'm guessing all the code will get run together once I click submit, but here is how I create the diaglog box (it was working fine without the "WinAppRegisterModelessDialog", but I saw a reference to it elsewhere and tried it to see if it would help, not sure if it actually serves any useful purpose):
    statWin = sADMDialog->Create(inPluginRef, DIALOG_ID, IDB_DIALOG1, kADMModalDialogStyle, NULL, NULL, 0);
    WinAppRegisterModelessDialog((HWND)sADMDialog->GetWindowRef(statWin));
    infoBox = sADMDialog->CreateItem(statWin, 5, kADMTextStaticType, &coords, NULL, NULL, 0);
    // Status header
    coords.top = coords.bottom + 10;
    coords.bottom = coords.top + 12;
    statHeader = sADMDialog->CreateItem(statWin, kADMUniqueItemID, kADMTextStaticType, &coords, NULL, NULL, 0);
    // Status line
    coords.top = coords.bottom + 10;
    coords.bottom = coords.top + 12;
    statLine = sADMDialog->CreateItem(statWin, kADMUniqueItemID, kADMTextStaticType, &coords, NULL, NULL, 0);
    // Progress bar
    coords.top = coords.bottom + 10;
    coords.bottom = coords.top + 15;
    progress = sADMDialog->CreateItem(statWin, kADMUniqueItemID, kADMProgressBarType, &coords, NULL, NULL, 0);
    sADMItem->SetMinIntValue(progress, 0);
    sADMItem->SetMaxIntValue(progress, totalPages);
    // Set window size, and other attributes
    sADMDialog->Size(statWin, coords.right + BORDER, coords.bottom + BORDER);
    sADMDialog->SetText(statWin, PROD_NAME " - Progress");
    // Set header for status line
    sADMItem->SetText(statHeader, " Page # % Complete Estimated Time remaining");
    // Initialize progress bar
    sADMItem->Update(progress);
    Updates are currently performed with the following code segment. The last two lines are my attempts to get the display to update once the screen blanks:
    // show it
    sADMItem->SetText(statLine, textBuf);
    // Update progress bar
    sADMItem->SetIntValue(progress, pagesCompleted);
    // Force display update/refresh
    sADMDialog->Update(statWin);
    // Yield for display update (in case of screen blank or user changes)
    Sleep((DWORD)100);
    Everything works fine until the window is moved or screen blanking occurs, after that nothing seems to work, all updates to the box cease to be displayed. Any suggestions?

    OK guys here's an update. First I went to BIOS and updated the initial display setting to "LCD panel only" from "Auto". At first I thought it helped, because when I worked at the laptop without the external screen attached, the internal LCD panel resumed normally from off (previously this didn't work).
    But today while I was in the office with my external 19" LCD screen attached, and both of them went off after being idle for 10 minutes, the internal LCD panel didn't resume again. So I've tried the Fn + F5 key combination to switch between modes, and I switched from dualview back to single. The internal LCD panel blinked for a second and then turned off immediately, and from that moment on, I was without picture on both of them. SO I ended up hibernating and resuming again. :( An important note - as soon as the computer began hibernating, the LCD went on and I could see the whole progress of hibernation before it turned off.
    Also another note - when I'm in dualview, I always have keep the internal LCD panel as the primary screen. So unfortunately, when it doesn't resume, I don't have access to the taskbar etc to try more things...
    Any more thoughts?
    Thanks again!
    Rado

Maybe you are looking for

  • Calling a web service in an ABAP code

    Hello Experts,       Is it possible to consume a web service in an ABAP code? Note: I am using SAP R/3 4.7. Thanks! Jeffrey

  • Issue with hr_person_type_usage_api.update_person_type_usage

    Hi, I'm trying to call the Oracle API: hr_person_type_usage_api.update_person_type_usage and I'm receiving the error: 'The HR object which is attempted to be locked is inconsistent with the corresponding object in the HR Schema.' Here's how it's bein

  • Blue bounding box - Can't Remove

    www.cfhda.com/menu.html In Firefox and Navigfator, but "not Safari or Explore," there is a blue bounding box around a link (pricing) at the bottom. It shows up in the DW doc, but I can't get rid of it. The link is a png in a table cell but there are

  • Monitor Glitching - Please help

    Ok, so I've run Apple's hardware test multiple times and just this morning I cleanly installed the OS but the problem persists. It's really hard to describe so I will simply link to a picture, because for some reason I am able to take screen shots of

  • Customer report query

    Hi,            I want ot find the list of customers who had no transaction in past 6 months. If I am using standard report of sales or Z reports of sales it won't bring customer with no transaction record. This requirement need to be fullfilled witho