Scripting a dialog window

Hello.
I'm using InDesign CS4 and I use JavaScript for scripting.
I would like to create a dialog window that will open when my script is run.
From that dialog the user can browse for the xml file he wants to import.
After the import the script will continue running and place the information from
the xml file to the proper text frames etc. etc.
Could someone please guide me to the right direction or possibly give me a ready solution
if it's not too much to ask.
Any help is appreciated.

for step 1, use File.openDialog () to get the File object.
Harbs
http://www.in-tools.com
Innovations in Automation

Similar Messages

  • Script to open the Open Dialog Window

    Hello everyone!
    I'm new to scripting and this is probably an easy question but I'm trying to write a script that opens the Open Dialog Window. Basically I need to start the script in one active document, have the script open the Open Dialog (to let the user select another image) and then finish the script in the newly opened document. Every script I find is to open a specific file, but I need it to be User Selected through the Open Dialog of Photoshop.
    I hope that makes sense! LOL. Any help would be greatly appreciated!
    Thanks,
    Bradi

    Is this also possible to simply open the "Find and Replace" dialog in Illustrator & then close it?
    No need to do anything with "Find and Replace" just want to open it then have it close to avoid an Illustrator bug.

  • Passing values to a modal dialog window...

    Hi All,
    Is there a way to pass massive amount of data into a pop-up
    modal dialog window? I have this following code that keeps giving
    me a JavaScript error whenever I have like 2000 characters in the
    documen.myForm.Product_Details textarea field. Any suggestions or
    advice is greatly appreciated, and thank you very much in advance!
    function Modal_NewWin() {
    var width = 750;
    var depth = 200;
    var productDetails = document.myForm.Product_Details.value;
    var url =
    "PreviewProducts.cfm?ProductID=#GetProductInfo.ProductID#&ProductDetails="
    + productDetails;
    var sfeatures = "dialogHeight: " + depth + "px; dialogWidth:
    " + width + "px; dialogTop: px; dialogLeft: px; center: Yes; help:
    No; resizable: No; status: No;";
    return window.showModalDialog(url,'',sfeatures);

    can you use JSStringFormat() without first submitting the
    form??? (so CF can see the value in the form field jsstringformat
    is applied to..)
    submitting a form to the preview page will solve the problem
    for sure, but then you will somehow have to have 2 different action
    target for the form, so that clicking 'preview' button submits the
    form to the modal window, and clicking a 'save' button will submit
    the form to another action page that inserts values into a db...
    you can do that, again with some more javascript...
    as html-escaping javascripts are readily available on various
    script sites, i think it will be easier to employ one of them...
    (please note that i am assuming quiet a lot about how the
    AppDeveloper's form works and what it does, since he never
    explained it himself...)

  • Close dialog window by clicking on 'X'

    Hi
    I am displaying a dialog window that allows the user to modify data.
    When the user clicks on the 'Cancel' button I have placed on the window, the action code fires and the return listener fires.
    I have added some java script that executes the following command when the user closes the dialog by clicking on the close icon.
    submitForm("groupCaptureForm",0,{source:"cancelGroup"});
    Basically simulating a click on the 'Cancel' button.
    For some reason when the user closes the window by clicking on the close icon, the action code fires, but the return listener code never fires.
    Any idea why?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • File without opening the dialog window

    How do I open a file on Mac without dialog window using a pre-defined path network?
    example: myfile / mytest / mytestfile.ai
    Thanks

    Hi Ferrarezzi
    Just a tip
    If you look at your computer..in the same folder where Extended Script Toolkit application is installed, there´s a PDF called JavaScript Tools Guide.
    This guide has a chapter that covers all the File and Folder methods and properties. Read it. This would give you a great overview of what you can do with Files and Folders
    Best Regards
    Gustavo.

  • Without dialog window?

    I have an AppleScript that sends a message from one computer to another via Bonjour. I don't want dialog window to pop up. Is it possible? There is property "fisible" for vindows, but I am not sure how to impement it. Or may be there is the way to close window after message is sent. I think, it should be easy, but I am new in AppleScript, so any help will be appreciated.
    I posted this question in iChat forum too, but think here it's more appropriate.
    Thank you in advance
    Vera

    I send message by iChat, computers connected via Bonjour. Very simple script:
    tell application "Finder"
    set the_message to "....."
    set the_account to "Bonjour:...account id....."
    tell application "iChat"
    send the_message to first account whose id is the_account
    end tell
    end tell
    I don't want the window to pop up on the machine which sends the message. I know in InDesign there is an option "without showing window", but here it does not work.
    Best regards
    Vera

  • Dynamically Create (and reference) Dialog Window Groups

    I'm trying to setup a dialog window that can be easily added to via a CSV file.  The only problem I've run into is; I'm not quite sure how to create the groups dynamically.  Basically, the script setups up a bunch of texture features and then gives the option to save and/or strip that feature.  Below is the basic idea of what I'm trying to do, but the groups are not able to be created in the way that they are shown:
    featArray = [];
    featArray[0] = new Array("Feature Display Name","feature sub-group",'texture',"feature action",'feature type');
    featArray[1] = new Array("Feature2 Display Name","feature2 sub-group",'texture',"feature2 action",'feature2 type'); //etc.
    for(var z in featArray) {
        if(featArray[z][2] == 'texture') {
            w.p1.sp1.add('statictext',undefined,featArray[z][0]);
            w.p1.sp1.g[z] = w.p1.sp1.add('group');
            w.p1.sp1.g[z].orientation = 'row';
            w.p1.sp1.g[z].add('checkbox',undefined,'Save');
            w.p1.sp1.g[z].add('checkbox',undefined,'Strip');
            w.p1.sp1.g[z].children[0].id = featArray[z][0].toLowerCase() + "-save";
            w.p1.sp1.g[z].children[1].id = featArray[z][0].toLowerCase() + "-strip";
    If you change the g[z] to g1, it will create each field correctly (visually), but there is no way to properly reference the check boxes to see which are checked.  Any ideas how, or even if, it is possible to dynamically create a different group for each line of the featArray?  And if so, how to then reference the check boxes in those groups later on?  Thanks in advance for any help!

    You just use the array ie:
    featArray = [];
    featArray[0] = new Array("Feature Display Name","feature sub-group",'texture','feature group','feature type');
    featArray[1] = new Array("Feature Display Name2","feature sub-group2",'texture','feature group2','feature type2'); //etc.
    var w = new Window('dialog','test');
    w.p1= w.add("panel", undefined, undefined, {borderStyle:"black"});
    var x = new Array();
    var count =0;
    for(var z in featArray) {
        if(featArray[z][2] == 'texture') {
            w.p1.add('statictext',undefined,featArray[z][0]);
    w.p1.g = w.p1.add('group');
    w.p1.g.orientation = 'row';
    x[count] = w.p1.g.add('checkbox',undefined,'Save');
    count++;
    x[count] = w.p1.g.add('checkbox',undefined,'Strip');
    count++
    x[0].onClick=function(){
        alert("Checkbox 0 clicked");
    x[1].onClick=function(){
        alert("Checkbox 1 clicked");
    x[2].onClick=function(){
        alert("Checkbox 2 clicked");
    x[3].onClick=function(){
        alert("Checkbox 3 clicked");
    w.test = w.add('button',undefined,'Press to Test');
    w.add('button',undefined,'Cancel');
    w.test.onClick=function(){
    for(var w =0;w<x.length;w++){
        alert("Checkbox " + w + " value = " +x[w].value);
    w.center();
    w.show();

  • How to supress dialog window "missing fonts"

    Hi, i place a RTF file using scripting. When the RTF uses fonts, which are not available a dialog windows appears "missing font: ... substitute fonts..." and the script stops.
    How can i supress/disable this dialog window?
    Is there are general mechanism to supress dialog windows, when scripts are running?
    Thanks!
    Gerd

    Hi Gerd,
    suppress the message with
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    But dont't forget to reset the interaction level before finishing the script:
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
    Otherwise you will miss some dialogs in future.
    Martin

  • Open list form across host header site collections via Modal Dialog window

    Hello,  I have a web application that has two host header site collections in it.  When a user is on Host Header A, I need to open a list's display form that's located on Host Header B.  I'm using the JS function  SP.UI.ModalDialog.showModalDialog(options)
    to open a dialog window to the host header B list's display form.  It loads and shows all the columns, but there are a couple issues.
    1) The scroll bar on the dialog window is not active (can't scroll up or down to see all the columns).  This is an issue on all browsers (IE 8 &9, Chrome, FF)
    2) In IE, the SP ribbon does not display.  In Chrome and FF the ribbon does display and the buttons work fine.
    There's no errors in the ULS logs, and if I use IE8, there's a JavaScript "Access Denied" error.  I've confirmed the user account has permissions on both sites & list.
    My first thought had to do with anonymous access being turned on at the web application level (not the site level) and the credentials not being passed to the new site collection.  But this isn't the case because in Chrome, the ribbon shows and the
    buttons are security trimmed correctly based on the users permissions.  So I know the credentials are getting passed through the dialog window.  And when I use the "Edit' button on the ribbon in chrome, it opens a new dialog window and everything
    works correctly (Scroll bar and ribbon).
    Has anybody been able to successfully open a list form across two separate host header site collections?

    I ended up getting around the cross site collection in the modal window issue by using a custom ASPX page that works as a redirect using JS.  
    The link the end user clicks pops open the aspx page in a dialog window.  I then pull the URL of the list item I want to open from the URL and have JS open that form in the modal window.  The key seems to be to open the redirect aspx page under
    the same site collection as the list item you want to view.
    Here's the JS that's in the aspx page.
    <script type="text/javascript">
    // We name the current dialog windown
    window.name = "newSiteWindow";
    // wait until we know the the JS lib is loaded
    ExecuteOrDelayUntilScriptLoaded(loadNewSite, "sp.js");
    function loadNewSite() {
    //grab the list item URL from the URL of the dialog window using a pre created function
    newURL = GetUrlParmByName("listItem");
    //append our dlg query to the end so everything displays correctly. If you do not use IsDlg=0, the ribbon does not display and the window will not scroll.
    newURL = newURL + "&IsDlg=0";
    //use the current window to open the list item we want to go to.
    window.open(newURL, "newSiteWindow");
    </script>

  • Scripting a simple window

    Hi,
    I'm not sure even what to call this, but does anyone know where I can learn to script user interface windows that pop up at the start of a script
    I can imagine one furnished with drop-down menus and radio buttons, etc, that allows the user to select which actions they'd like to run on what layers in a psd file.
    Is this even possible?
    What's it called when you make windows like this in Photoshop Javascripting?
    Are there any good tutorials online?
    Thanks,
    Tom B

    Adobe calls that ScriptUI and you can find out about the class, properties, and methods in the Javascript Tools Guide. I don't know of any online tutorials but over at PS-Scripts we have lots of examples and snippets.
    If you are using Windows there is a free app that will let you create a dialog by dragging and dropping the controls. When you are done it creates a resource string that you can use in your script. http://www.jkozniewski.com/tools/CSUIB_2.0a.zip  I used it when I frist started making dialogs but now I don't like the resource method of creating dialog. And it has not been updated in a while. Still you might want to have a look.
    There is also a fee baised app. I don't have a link but they posted info about it here so a forum seach might find it.
    But I think your best bet would be to go to http://www.ps-scripts.com/bb/ look at the examples there and when you need help make another post either here or there.

  • ScriptUI run script from dialog button

    Here is what I have right now.  It is a little clunky in the way it works, and I would just like to make it a bit slicker.
    I have a script on startup that creates a Menu item with a dropdown submenu item. when you click on the submenu item, it starts a script. 
    The first thing the script does is pop up a message box that tells them that two dialog boxes are going to popup. The first one asking them to choose the location of an xml file and the second dialog box that ask them to choose the location of their image folder.  After they finish choosing their folder in the second dialog, the script takes those two values, makes them variables, and continues to run the rest of the script. 
    Here is what I would like it to do..
    1. open a dialog window with two input fields, two "browse" buttons, and OK and CANCEL buttons
    2. when you click the first browse button next to the first input field, it will open a file dialog window.  You select your file and the file string will populate the input field
    3. when you click the second button next to the second input field, it opens a folder dialog window.  You select the folder and the string populates the second input field.
    4. when you click OK, it feeds the values in the input fields to a script.
    I already have scripts to that open the file and folder dialogs, but what I can't figure out  how to do is to start and run a script from a button press, in this case, when the OK button is pressed.  It is probably an onClick, but I haven't been able to find any examples of what the syntax would be. 
    The closest I have found is in the Beginning ScriptUI document that was on Jongware's site, in the section on Communication between windows.  But that opens each of the windows with a different script and not using a button press to call a script.
    As always, any point in the right direction is very much appreciated. thanks.

    Thanks Gotterman, but the issue I was having was that the dialogs I was opening were not being created by me.  They were more like OS generated windows.  So I am not able to give the window a name, or the input field a name in order to reference it.
    Peters response was actually correct, although I did have to open the folder dialog a bit differently to get it to work.  I had to use a style that I got from Jongware in a previous thread, but the concept that Peter showed in the last post pointed me in the right direction. 
    I just have one more piece to figure out, how I am going to pass the variables to another script, but I think that is something i will have to work out on my own.
    For anyone who is curious, here is the code I came up, modifying and combining some of Peters examples from the book plus the help he gave me in this thread.  The alert after closing the dialog is just for testing to show that the values are being held by the variables so I can use them else where.
    function mySnippet(){    
    //<fragment>   
    #target indesign;
    #targetengine "session";
    var w2 = new Window("palette", "Window 2", undefined, {resizeable: true});
    var e2 = w2.add ("edittext"); e2.characters = 30;
    var e3 = w2.add ("edittext"); e3.characters = 30;
    var f2 = w2.add ("button", undefined,"Browse XML");              
    var f3 = w2.add ("button", undefined,"Browse Folder");              
    var f4 = w2.add ("button",undefined,"SAVE AND RUN");              
    var tf              
    var tfo                
    f2.onClick = function()                {               
    tf = File.openDialog("Select your XML File","*.xml");                    
    if (tf != null)                    
    e2.text = tf;                    
    f3.onClick = function()                {              
    var tfol = new Folder("~/My Documents")               
    tfo = tfol.selectDlg("Get Folder");                    
    if (tfo != null)                    
    e3.text = tfo;                    
    f4.onClick = function()               
    w2.close();                   
    alert ("xml value: " + tf  + "\nfolder value: " + tfo);                
    w2.show();    
    //</fragment>

  • Time machine would back up only the first time after I shut off my imac and started it up again.  Then it would fail or claim it could not locate my external Hard Drive even though it's icon was showing in the time machine dialog window.

    Time machine only ever backed up the first time it runs immediately after I start up my computer after it has been shut off.  All other back up attemps fail.  Recently it stopped recognizing the icon for my external hard drive in the time machine dialog window where you select the hard drive to back up to, and turn on and off the time machine function.  Now the external HD icon only shows up on the desk top but no longer in the dialog box. I just tried shutting the computer off and turning it on again and now the light is on, on the external hard drive but the icon does not even appear on the desk top.
    The external hard drive is a 1TB Seagate. The drive still has plenty of unused capacity.  I ran a diagnostic test on it. It said the disk needed repair but the repair function would not work. The message stated that it could not be unmounted and repair is not available because the disk can't be written to. The Mac OX utility said the disk can still be opened but can't be changed nor repaired.  The external HD is not S.M.A.R.T. supported.
    I haven't tried replacing the cable yet. Is that the next thing I should try?

    What Mac OSX version are your running ("iOS" as shown in your profile cannot run on a Mac computer)?

  • Refresh Table Data after dialog window is closed.

    My JDeveloper version is 11.1.1.6.0
    I have a master-detail scenario where in Master records(Table Component) are displayed in top half of the splitter panel.
    Detail records are displayed in second half of the splitter control using table components placed on tab panel.
    After clicking on the LinkButton in Master record a bounded-task-flow is invoked in a separate inline dialog window (applicaitonModal).
    In the dialog window changes to the child records is done using SelecteManyShuttle Component.
    After invoking the commit action to close the modal window the child records do not refresh or the child records do not display changes immediately. Only after the page is refreshed the changes are visible.
    Kindly suggest a solution.
    Thanks
    Deven

    are you using af;dialog then you cn use dialog listener see this
    http://www.techartifact.com/blogs/2013/03/handling-ok-and-cancel-button-in-afdialog-using-popup-in-oracle-adf-by-dialogl…

  • Using a dialog window to select a name and directory to save the file

    Hi there
    I have a problem with the FILE_SAVE_DIALOG method or better with the windows that will be shown.
    Before I save a file (e.g. PDF file) on the presentation server (the PC), I want to open a dialog window to have the option to give another directory and file name, under which I will save the file.
    Therefore I use the method CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG. I found many information about this FILE_SAVE_DIALOG in this forum, but these tips didn't satisfy me.
    The main problem is the FILE_FILTER. How to use this filter (is it a STRING?) properly, when I want to have a list in the dialog window? Nothing worked till now.
    I use ERP 2005 with JAVA 1.4.1-07.
    My Code:
    DATA: fileName         TYPE  STRING,
          path             TYPE  STRING,
          workdir          TYPE  STRING,
          user_action      TYPE  I,
          encoding         TYPE  ABAP_ENCODING.
        fileName = I_FILENAME.
        path = I_PATH.
        CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
           EXPORTING
             WINDOW_TITLE         = 'Save Adobe PDF file'
    *         WITH_ENCODING        = 'X'
             INITIAL_DIRECTORY    = workdir
    *         DEFAULT_EXTENSION    = '*.pdf'
             DEFAULT_FILE_NAME    = fileName
             FILE_FILTER          = '*.pdf'
             PROMPT_ON_OVERWRITE  = 'X'
          CHANGING
             FILENAME             = fileName
             PATH                 = path
             FULLPATH             = fullpath
             USER_ACTION          = user_action
             FILE_ENCODING        = encoding
          EXCEPTIONS
             CNTL_ERROR           = 1
             ERROR_NO_GUI         = 2
             NOT_SUPPORTED_BY_GUI = 3
             others               = 4.
        IF SY-SUBRC <> 0.
          EXIT.
        ENDIF.
        IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
          EXIT.
        ENDIF.
    When I call this method with these parameters, I get the dialog window, but there is no filtering for PDFs.
    I also tried the ideas with:
      FILE_FILTER = 'Adobe files (*.pdf)|(*.pdf)'
    and so on. But nothing made the dialog window work properly, even the selection list didn't show the right content to select.
    Who can help with this method SAVE_FILE_DIALOG?
    Thanks
    Frowin

    HI,
    check this program.
    <b>
    report ZTEST2.
    data:  file type string,
           path type string,
           file_path type string.
    data: itab type standard table of cskt.
    start-of-selection.
      SELECT * FROM cskt INTO TABLE itab.
      call method cl_gui_frontend_services=>file_save_dialog
          exporting
                    FILE_FILTER = '*.PDF'
          changing FILENAME = file
                   path     = path
                   fullpath = file_path.
      check not file_path is initial.
      call method cl_gui_frontend_services=>gui_download
        exporting    filename                = file_Path
                      WRITE_FIELD_SEPARATOR = 'X'
         changing    data_tab                = itab.
    </b>
    REgards,

  • Open File dialog window when setting the value of a path type input argument in a VI call

    Hi,
    I am new to TestStand (running 4.0) and I want to create a sequence of VIs to turn on, setup and measure a device. One of my VIs sends a configuration file to my device. An input argument to this VI is the path of the config file. I would like to make it simple to modify this path when setting up the sequence by popping up the File Open dialog window and choose my file. Is this possible? I do not want to manually change the file during execution, just to have multiple calls of one VI, each call opening a different file according to the path given to it during the setup. 
    So far I have only succeeded in manually entering the absolute path each time I add this step. What makes it even more annoying is the fact that LabVIEW interprets the path with the escape codes, rendering the path unusable. Manually adding a 2nd backslash at each '\' occurence adds another step to the process. I tried both String and Path type of inputs, and the SearchandReplace() or ToUpper() (trying to bypass the escape codes) functions in TestStand don't seem to help m.
    Your help is very much appreciated,
    Fred

    Eudaemonic,
    If you want to create a series of easy to configure step types so others can develop sequence files easily, you could use custom step types. When you create a custom step type you implement your own configuration dialog. Since you have control over what controls you expose in your configuration dialog, you can design it so the desired path is selected using a open file dialog. Refer to chapter 13 of the TestStand reference manual for more information about custom step types.
    If you do not want to create a custom step type but you still want to give access to your sequence developers to pre-configured steps, you can use templates. A step template is a snapshot of a step that you can reuse later. Let's assume that instead of asking your users to edit the step to enter the desired path, you create several step templates with different pre-configured paths and based on their applications requirements they could use the appropriate template. Refer to the NI TestStand Help for more information about the Templates list on the Insertion Palette.  
    Hope it helps.
    Antonio Lie. 

Maybe you are looking for

  • Control or Option Click in Finder Problem

    Mouse click plus option Key, or Mouse Click with control key, all Icons on desktop disappear and reappear. Drive Icon moves, and new window appears. I have reinstalled OS 10.4, ran all updates, problem still exists. Problem does not exist in other lo

  • Cant import NEF RAW images into Photoshop Elements 9.

    before anyone says i have the updated camera raw plug in because i have already looked so it should work, but it doesnt. i took the images with the Nikon D3200 i NEF RAW format. but photoshop kept on saying that the format was not supported, i was op

  • TDS Configuration For Qatar

    Hello SAP TDS Experts, i am working for client in Qarar  recently qatar government is implimented  5% TDS on sub-controctors for that can i go for Extended withhoulding tax configuration . i have worked on configuration for india is the same congigur

  • Documentation on activesync email client

    Hi, Does anyone know where I can get documetation on the activesync e-mail client on the iPad? I need to find out exactly how this client behaves. ex: Is there a limit to how much e-mail it can download/folder? Does the e-mail get downloaded to a fol

  • Flash file in IFrame

    Hi, I have an HTML file with a bunch of flash tutorials (with voiceover) in it. Links of the flash files are on left side of the page and when we click the link, loading the flash file in an iframe on right side of the page... The page is working fin