How to remove "modal dialog box or alert" when the script is underway?

Hi all

I've created a script that will set the text of the rtf files from a folder to a document on a different page based on the correspondence. But if a font which was in doc file but absent on my mac, showed an error when running the script.

This means that Indesign has opened a missing alert police box and script stop to this line and the error shows "cannot process the request because a modal dialog box or the alert is active.

Is possible to remove this error and the script is continue to place all RTF files? I have little knowledge of try/catch.

indesign #target

myDoc var = app.documents.item (0);

sourceFolder var = Folder("/Users/admin4/Desktop/ec_txt");

myFiles = sourceFolder.getFiles ("*.rtf");

var myFrame1 = myDoc.pageItems.itemByID (111076);  Switzerland

var myDoc.pageItems.itemByID = myFrame2 (111114);  euro area

var myFrame3 = myDoc.pageItems.itemByID (111146);  Germany

for (var i = 0; i < myFiles.length; i ++)

{

switch (myFiles [i].name.slice (6, myFiles [i].name.lastIndexOf ("_")))

{

case 'Switzerland_en ':

myFrame1.parentStory.insertionPoints.item(-1).place (file (sourceFolder + "/" + myFiles [i] .name))

break;

case 'Eurozone_en ':

myFrame2.parentStory.insertionPoints.item(-1).place (file (sourceFolder + "/" + myFiles [i] .name))

break;

case 'Germany_en ':

myFrame3.parentStory.insertionPoints.item(-1).place (file (sourceFolder + "/" + myFiles [i] .name))

break;

}

}

To remove alerts, you can use different levels of user interaction.

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

Not forgotten to reset after the end of the script with the following:

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

Hope it resolve your request.

--------

Green4ever

Tags: InDesign

Similar Questions

  • How to create modal dialog box with image

    I have this very simple modal dialog box:
    public class DialogPanels
    {
    
        public void initClosemainAppDialog(final Stage primaryStage)
        {
    
            primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>()
            {
                @Override
                public void handle(WindowEvent event)
                {
                    event.consume(); // Do nothing on close request
    
                    // Dialog Stage init
                    final Stage dialog = new Stage();
                    // If you want to freeze the background during dialog appearence set Modality.APPLICATION_MODAL
                    // or to allow clicking on the mainstage components set Modality.NONE
                    // and set dialog.showAndWait();
                    dialog.initModality(Modality.APPLICATION_MODAL);
                    dialog.initOwner(primaryStage);
    
                    // Frage - Label
                    Label label = new Label("Exit from the program");
    
                    // Button "Yes"
                    Button okBtn = new Button("Yes");
                    okBtn.setOnAction(new EventHandler<ActionEvent>()
                    {
                        @Override
                        public void handle(ActionEvent event)
                        {
                            //primaryStage.close();
                            //dialog.close();
                            //Platform.exit();    
                            System.exit(0);
                        }
                    });
    
                    // Button "No"
                    Button cancelBtn = new Button("No");
                    cancelBtn.setOnAction(new EventHandler<ActionEvent>()
                    {
                        @Override
                        public void handle(ActionEvent event)
                        {
                            primaryStage.show();
                            dialog.close();
                        }
                    });
    
                    // Layout for the Button
                    HBox hbox = new HBox();
                    hbox.setSpacing(10);
                    hbox.setAlignment(Pos.CENTER);
                    hbox.getChildren().add(okBtn);
                    hbox.getChildren().add(cancelBtn);
    
                    // Layout for the Label and hBox
                    VBox vbox = new VBox();
                    vbox.setAlignment(Pos.CENTER);
                    vbox.setSpacing(10);
                    vbox.getChildren().add(label);
                    vbox.getChildren().add(hbox);
    
                    // Stage
                    Scene scene = new Scene(vbox, 450, 150, Color.WHITESMOKE);
                    dialog.setScene(scene);
                    dialog.show();
                }
            });
    
        }
    }
    I want to add images and make to look like this:



    But I admin that it's too complex for my short knowledge get the appropriate result. Can you show me how I can split dialog box, add second bottom and make my code to look the same as this example please?

    I think that you can accomplish what you want by wrapping your 'vbox' VBox in an another VBox... Let's call it outerVBox. In outerVBox, you put a node ImageView and 'vbox'. To create the node ImageView (for example):

    Image bkgrdImage = new Image(getClass().getResourceAsStream("resources/my_pic.jpg"));
    ImageView bkgrdImageView = new ImageView(bkgrdImage);
    

    And then add nodes to outerVBox:

    outerVBox.getChildren().addAll(bkgrdImageView, vbox);
    

    (And of course to create the scene instance using outerVBox instead of "vbox.")

  • How to remove otomatis dialog box?

    When I press return on a screen, dialog screen see alert him choice of Pentecost Save, Discard, cancel... I want it to show not when I click navigation back? any solution? Thank you

    Hello

    Replace the onSavePromt function.

    Check out this thread:

    http://supportforums.BlackBerry.com/T5/Java-development/disable-the-prompt-for-save-discard-and-CANC...

    E.

  • Dialog box print short when the new printer synchronized via CS5 how do you get the options the printer?

    I recently purchase a new printer - the Epson SureColor P800 and trying to set up my preferences to print found the print setting dialog box is abbreviated. It is no longer a printer asking drop to disable color management.  Instead, there is a box of media and quality. I can't disengage from the printer color management to get the proper color balance. Help! I tried to update my CS5 and also run into snags is that related?

    Hi RuthC,

    Could you please attach a screenshot of the print window.

    Also what operating system you are working on Windows or MAC?

    Kind regards

    Tanuj

  • the finePix camera dialog box stopped appearing when the cable is connected

    have always been able to download from FinPixE500 to windows vista.  Now, when the USB cable is connected, the dialog box does not appear.  I tried to reinstall the drive, but received message this update already installed version.

    Take a look at this link.

    http://www.ehow.com/how_2272478_change-Autorun-settings-Windows-Vista.html

    I hope this helps.

  • How to remove a VM inventory in vcentre when the host is down

    Hi guys,.

    We had a power outage today where one of our physical ESX host is dead (we have 2 VM cluster hosts).  HA/DRS unfortunately does not work as there are insufficient resources to automatically migrate the virtual machines on the host failed through to the host remaining (another separate question that I will not here address)

    when the hsot went down, virtual machines have been left in the market, but were in a disconnected state (see table).  I read that you can reallocate virtual machines to another host by 'navigate to the data store and do a right-click on the vmx file and click Add to inventory and select the host. " (Ref: ) http://communities.VMware.com/thread/173314 )

    However when I browse to the data store, the option 'Add to inventory' has also dimmed.  I suspect (Please confirm) that he wwas because the virtual machine in question was still at the "running" State  problematic, because that disconnected/running state, I could not close it out vcentre gui (or console, as host was dead)

    can someone tell me how - if possible - can I migrate the virtual machine to another host, while in the situation described above?

    If this is not possible for future situations where the host is lost, I would be better together virtual machine to stop? (this would allow me to reassign the vms can?)

    see you soon

    The virtual machine will remain in the host inventory and disappear once you remove the host to vCenter inventory. What you then do - at least that's what I would probably - to be able again to power on virtual machines is to register the virtual machine to other hosts on the server vCenter Server (click right the VM .vmx file and choose 'Add to inventory')-after the correction of the host and before adding it again to vCenter Server - connect directly to this host and then delete the virtual machine already 'moved' from his inventory.

    What you need to do after registration of VM for other hosts is to check the VM based backup applications (if used), because the virtual machine will receive new ID.

    André

  • How to set the location of the display of the modal dialog box?

    Hello

    Setting the height of a modal dialog box seems to influence the position of the modal dialog in the window.

    (See also the Position of the modal dialog box)

    If anyone can confirm this? And if so, how can I handle it?

    Thank you

    Jos

    Hello

    Thanks John: How to persist APEX dialog size and position. HardLikeSoftware

  • How can I listen to a modal dialog box?

    I open a bunch of files and every 500 or if I have a modal dialog box that opens. Some of these files are 10 years old so the fonts are retired etc.. Is there a way to detect if a modal dialog box is displayed when a file is opened? If so is it also a way to delay the next iteration of the loop until the dialog box has been addressed, but still have the never value userInteractionLevel?

    It would be interesting to know what kind of dialogue still appears. Missing links and missing fonts are removed, I know for certain. Don't know what else could be wrong during the open file. Trying to open a newer version may be, for example try to open a file of CS6 in CS5?

    Peter

  • How to open a modal dialog box of click of a button on the Panel?

    Hi all

    I tried to open a modal dialog box on the click of a button on the Panel the other day. But failed. I managed to have a panel appear on click of a button. But the Group appeared at the forefront of the parent panel. I don't want to. Here are some screenshots of what I managed to do and what I want to do.

    This Panel will appear on the click on the button "Click." Note that the child Panel cannot be moved outside the bounds of the parent panel.

    1.JPG

    Instead, I want the behavior of the child Panel as shown below. As the modal dialog box that appears when we create a new action game in the Actions Panel.

    2.JPG

    This Panel can be moved all around the application window. Kindly guide my way through from there to achieve.

    Thank you!

    Post edited by: poortip87

    You can open a modal secondary window like this:

    var w: Window = new Window(); A mx:Window, or your own subclass

    w.type = CSXSWindowTypes.MODAL_DIALOG; in the package com.adobe.csxs.types

    w.Open ();

    There are up to four types of different windows that you can open in the form of secondary windows, although not all are currently available in all products.

    HTH

    David.

  • Foglight display size of the modal dialog box

    Hello

    Dashboards drilled down, I can choose how to display the detailed view.  So I chose popup--> the modal dialog box.  Now when I click on a line, instead of leading me to another page, it will display a popup window and view detail info.  The popup window has a fixed size and I can't change it.  Is there a way to change or set a certain size?

    Yes. You must change the settings from the view of exploration down, not the parent view. The settings are located under Configuration-> Options of Popup. You can play with the default size, size maximum and scroll bar to display the drilled down. It took me a while to figure this one out myself.

  • Position of the modal dialog box

    Hi,.

    Could someone explain to me how the op i tion to the wide a modal dialog is calculated?

    I put the height of my modal dialog box to 780px (all of the page of the dialog box is displayed), and the modal dialog box is displayed at the top of the window:

    780px.PNG

    A user complains that the modal dialog box is located roughly halfway to the window and having to drag upward to display all items and buttons.


    After you change the height to 600px, I get the same answer (the modal dialog box is about to halfway through the window) on my environments: different types of MacBook (Air/Pro), a window PC, all modern browsers.

    600px.PNG

    Then sometimes (how SMART is that! ) ) the modal dialog box (with the height value 780px) is positioned at the top of the page, sometimes the top less x.


    Thank you


    Jos

    Thanks John:

    Hello

    Thanks John: How to persist APEX dialog size and position. HardLikeSoftware

  • Helps the modal dialog box a value back to the calling page

    Greetings,

    Apex Version: 4.1.0.0.32


    What I'm trying to do is create a modal dialogue that is called from a form page. The user dialog box will report to IR which allow him to select a line and send a value of this line to a field of the calling page. I work in Firefox, but I get an error using IE 8. I hope that someone can show me why it does not work in Internet Explorer.

    Here's how I do it:

    Of the calling page:

    Created a button
    Action: Redirect URL
    Target URL: javascript:var rc = window.showModalDialog ('f? p = & APP_ID.:70: & SESSION.: & DEBUG.:', ",'resizable: Yes;) Center: Yes; dialogWidth:1000px; dialogHeight:500px ;') ;


    On the page called:

    The called page is an IR report where the query returns this as one of the columns:

    * (Note: I had to put a point '.' before the onclick so he could show in this thread.) It is not there in my actual code.) *
    select
    <a href="#" name="z" style="color:blue; text-decoration:underline;" .onclick="javascript:passBack(''' || LOT_NO ||''');">Select</a>' SelectThis
    , column1
    , column2
    from sometablename;
    This solves the anchor:
    <a .onclick="javascript:passBack('232158');"  href="#">Select</a>
    Here is the function Javascript is called the anchor onclick:
    function passBack(passVal1)
    {
      opener.document.getElementById("P75_ITEM1").value = passVal1;
      close();
    }
    When I run the present in Firefox, it works as expected. I click the button on the parent page. The modal dialog box is open and the report of the IR is displayed. I click on one of the links in the report and it returns the correct value to the appellant and closed page modal dialog box.

    When I run it in IE8, it fails. I click the button on the parent page. The modal dialog box is open and the report of the IR is displayed. I click on one of the links in the report and I get this error: 'opener.document is null or not an object ".

    I hope that it is clear and that someone can help.

    Thank you

    Larry

    A quick google search determines that window.opener does not exist when you use window.showModalDialog

    Range of suggestions to use window.open instead of window.showModalDialog to use instead of window.opener dialogArguments

    Try the following:

    The parent page to define a getPopupValue() function:

     function getPopupValue(){
       var dr =  window.showModalDialog('f?p=&APP_ID.:70:&SESSION.::&DEBUG.:::','','resizable:yes;center:yes;dialogWidth:1000px;dialogHeight:500px;');
    
        if ( (dr != undefined) && (dr != '') && (dr != false) ){
         $x("P75_ITEM1").value = dr;
        }
     }
    

    Change the url of the button to call the function:

     javascript:getPopupValue(); 
    

    On the popup page change the valve function for:

    function passBack(passVal1)
    {
      returnValue = passVal1;
      close();
    }
    
  • How to close this dialog box modal blocking and open a new one after a few minutes

    It's my method to display a modal dialog box:

    public static dialogue handleInactivityDialog (String msg, int [] values) {}
    Diálogo dialog = new dialog box (msg, new String() {"Yes", "No"}, values, 2, null);
    int i = dialogo.doModal ();
    If (I == 1) {}
    try {}
    do something
    Utils.popScreenForLogout ();
    } catch (Exception e) {}
    Utils.forceLogout ();
    }
    }
    return of diálogo;

    }

    After 3 minutes, this dialogue must be closed and should be opened a new. The new dialog box must be closed after 1 minute.

    I have no idea on how to do as DIalog.doModal () is a blocking operation.

    Thanks in advance!

    You can start a timertask before calling doModal, for example.

  • Cannot process the request because a modal dialog box or the alert is active

    I can't work for the life of me why I get this message when "cannot process the request because a modal dialog box or the alert is active. I simplified my code to reproduce the problem.

    All I want to do is have a dialog box that allows me to edit items on the page... But it does not seem to allow it. I must be missing something simple.

    var selection = app.activeDocument.selection[0];
    
    dialog = new Window('dialog');
    
    var button = dialog.add('button', undefined, 'Resize');
    
      button.onClick = function() {
    
      selection.geometricBounds = [0, 0, 10, 10];
    
    };
    
    dialog.show();
    

    If you use 'dialogue', then you must leave the modal state to interact with the app was done by closing the dialog box.

    var w = new Window('dialog');
    var v = w.add ('edittext');
    var b = w.add('button');
    b.onClick = function(){
        w.close(1);
    }
    if (w.show()==1) alert (v.text);
    

    Or switch to modal MOM like brother suggested dialog boxes...

    Loïc

    Ozalto | Productivity-oriented - Loïc Aigon

  • How do hide us the modal dialog box for the second time.

    Hi all

    I've done the process by creating the dialog box modal, everything works fine but once again when the page is loaded it is showing the new dialog box.
    How we can limit the process of dialogue.

    The steps of #.

    1 created an onload function like onload = "promptUserSearch (); »
    2. has created a vaibale hidden like 'P6_CHECK '.
    3. setting of what is hidden as "O" in javascript as funcation
    function promptUserSearch() {}
    {if ((document.getElementById('P6_CHECK').) Value is 'Y')}
    $('#dialog-confirm').dialog ('open') ;}}
    4. has created a process of the page header and check the number is greater than or not.
    5 given that I am setting the P6_CHECK as "Y" or "N".
    6 intally when loading the page in the scrren mine it will be and by deafult if they click on the button search then I need display the dialog box that is to the poster, but when I click on the "entry" button in this dialog it will load the same page but once again the dialog is apperaing agaian in this scenerio. How I need to solve this problem?



    For your Favorites, I put the query in the page header process

    declare
    number of v_count;

    Start

    SELECT count (*) from v_count
    MF FORM.
    BM bench,
    part PP,
    tag KT
    WHERE MF. ENGAGEMENT_ID = BM. ENGAGEMENT_ID
    AND WB. ENGAGEMENT_ID = PP. ENGAGEMENT_ID
    AND PP. ENGAGEMENT_ID = KT. ENGAGEMENT_ID
    AND (MF. ENGAGEMENT_ID =: P6_ENG_ID OR KT. KEY_TAG =: P6_ENG_KEY OR BM. REFERENCE =: P6_ENG_BENCH OR PP. PARTICIPANT =: P6_ENG_LEAD
    OR FM. ENGAGEMENT_COUNTRY =: P6_ENG_CNTY OR MF. ENGAGEMENT_COUNTRY =: P6_ENG_CNTY OR MF. ENGAGEMENT_STATE =: P6_ENG_STA
    );

    If v_count > 0 then
    : P6_CHECK: = 'N';
    on the other
    : P6_CHECK: = 'Y ';
    end if;
    end;


    Thank you
    David...

    Can you reproduce this on apex.oracle.com?

    Also to encapsulate the code between the tags {noformat} {noformat}

Maybe you are looking for

  • Not able to convert the region

    I have a track recorded on a microphone and I sliced off the coast of a new region. I am trying to edit the new area without affecting the rest of the track. When I right click > Convert, all options (convert to the new area, etc.) are dark and unava

  • can I use 2A ipad charger to charge my iphone 6 s faster?

    can I use 2A ipad charger to charge my iphone faster 6s?

  • shared variables does not

    Hello, I'm writing because I'm having a problem with the use of shared variables. I am doing a project for College and I use the DSC for his shared variable function. The problem im having is that shared variables do connect it no more. I followed a

  • Free games included with Windows Vista will not start.

    I tried to start one of the games for free in Windows Vista (Chess Titans, FreeCell, hearts, Mahjong Titans, Solitaire etc.) but I get an error measage: "this file has no program associated with it for performing this action.  Create an association i

  • I'm looking to upgrade Acre aspire 5942g (ram) 4 GB to 8 GB? This compatible SNID:10310567716?

    I'm looking to improve my memory of laptop Acer 5942 G from 4 GB to 8 GB or anything but is this compatible with my acre aspire 5942G ram Intel core i5 - 460 m (2.53 ghz, 3 mb l3 in cash) by default is 4 GB ddr3 memo win 7 home premium 64-bit