Script to open the dialog box "Insert reference."

Hello

I'm trying to get something that I (thought) is quite simple. When I right click I want to add a menu option to the context Menu to open the "Insert cross-reference...." "Dialog box. But I can't seem to progress actually open this dialog box.

Here's what I have:

(1) I understand how to add context, based on http://www.hubbers.info/content/customize-indesign-and-incopy-contextmenus menu item

(2) I understand in general how to launch the menu items, based on http://www.indiscripts.com/post/2010/02/how-to-create-your-own-indesign-menus

However, I can't seem to understand whence these keys, and what is the key to the reference/menu dialog box. They reference the findKeyStrings() function, but it does not seem to return anything to "Insert cross reference", a name in my language menu item:

app.findKeyStrings ("hyperlinks and cross-references")

Result:

app.findKeyStrings ("Insert cross-reference...")

Result:

I tried to change another script I found who poured everything menu ID, to empty the key values. While the "Insert cross-reference...." "and"Links and references"both appear with a box and identification, the KeyString is empty! I'm doing something wrong?

Thank you

-Colin

Here is my script list the IDS:

var myActions = app.menuActions;
var myActionsList = Array();
var counter = Number(0);

var menuMask = null;

var keyString;
for(var i = 0; i <myActions.length; i++){

    var nameStr = String(myActions[i].name);

    try {
        keyString = String(app.findKeyStrings(nameStr))
    }
    catch(all) {
        continue;
    }


    myActionsList.push(nameStr);
    myActionsList.push(String(myActions[i].area));
    myActionsList.push(String(myActions[i].id));    
    myActionsList.push(keyString);
}

var myDoc = app.activeDocument;
var myTextFrame = myDoc.pages[0].textFrames.add();
myTextFrame.geometricBounds = app.activeDocument.pages[0].bounds;

var myMenuActionsTbl = myTextFrame.insertionPoints[0].tables.add();
myMenuActionsTbl.columnCount = 4;
myMenuActionsTbl.bodyRowCount = myActions.length;
myMenuActionsTbl.contents = myActionsList;

Ah... Yes it makes sense, so he is right behind them ;-) But you right - it seems that findKeyStrings should ideally ignore these, you want to send the English version, not the "English with all these additional signs.

In fact, I don't remember. I was almost about to write a bug report. But I think it's just that the script documents are deficient:

* EDIT *: so if you are on Windows, you can determine the string to go straight. Press alt and use the keyboard to navigate in the menu, this will allow you to see where the ampersand should be added. For example here is my part of the menu:

There is a much easier way! The signs appear in the title property:

app.findKeyStrings(app.menuActions.itemByName("Insert Cross-Reference...").title)
Result: $ID/New XRef...

Tags: InDesign

Similar Questions

  • Can someone help me create a script to repeat to simply open the dialog box to create a link?

    Can someone help me create a script to repeat to simply open the dialog box to create a link?

    the "Connect" command uses the same dialog box as the command to "Place", except for the option "Replace" verified... so, use Ctrl + Shift + P to bring up the place dialog box, select your new image and select the checkbox "replace".

    If check 'Replace' with the mouse slow you down, after you have selected your image, the tab key 'press' 3 times to change the focus, and then press the SPACEBAR to check it out, then ok to place.

  • Photoshop opens the dialog box when you try to fill a layer with locked transparent pixels

    This script should set the layer to lock transparent pixels and then fill the layer with a color. She is doing this, except when it is in the filling phase, it opens the dialog box fill, and you have to hit OK.

    If you omit the transparent pixel line, it works as not expected, no dialog boxes.

    Is there a way to remove the box? Or I'm doing something wrong, which is causing the box to open?

    #target photoshop
    app.bringToFront();
    
    doc = app.activeDocument;
    doc.artLayers[0].isBackgroundLayer = false;
    doc.artLayers[0].transparentPixelsLocked = true;
    app.activeDocument.selection.fill(app.foregroundColor); 
    

    Not sure why this is happening.

    But I would recommend blocking the above and using the AM code for a fill that pays tribute to transparency.

    #target photoshop

    app.bringToFront ();

    doc = app.activeDocument;

    doc.artLayers [0] .isBackgroundLayer = false;

    doc.activeLayer = doc.artLayers [0];

    // =======================================================

    idFl var = charIDToTypeID ("Fl");

    var desc18 = new ActionDescriptor();

    var idUsng = charIDToTypeID ("Usng");

    var idFlCn = charIDToTypeID ("FlCn");

    var idFrgC = charIDToTypeID ("FrgC");

    desc18.putEnumerated (idUsng, idFlCn, idFrgC);

    var idOpct = charIDToTypeID ("PCT");

    var idPrc = charIDToTypeID ("#Prc");

    desc18.putUnitDouble (idOpct, idPrc, 100.000000);

    TSM var = charIDToTypeID ("Md");

    var idBlnM = charIDToTypeID ("BlnM");

    var idNrml = charIDToTypeID ("Nrml");

    desc18.putEnumerated (TSM, idBlnM, idNrml);

    var idPrsT = charIDToTypeID ("PrsT");

    desc18.putBoolean (idPrsT, true);

    executeAction (idFl, desc18, DialogModes.NO);

  • Adobe PDF opens the dialog box "Save as" when you simply save an existing file

    Any time I hit "Ctrl + S", or go to "File - save" when you are working on an existing file, it opens the dialog window "save under. And that is not enough, the window "save under" is this new version which adds an extra step (because he wants to know if I also want to save the file in the cloud) and makes me also navigate the current folder and when I hit save it also opens another dialog asking me if I really want to replace the current file... How heavy one set of steps just to save a file that you opened to make a little change - we do not save money, just save.

    Please, can someone fix this? I think he was born in the current version, the last, so it could probably be a bug (the 'Save' option is set by mistake the method "save under") or a poor handlebars by developers.

    Adobe staff has tried to help me, asking me to "Run as Administrator". This does not solve the problem, and my post has since been ignored...

    Any help would be apprciated. Thank you

    Problem addressed and solved on this post:

    Re: Why Adobe PDF opens the dialog box "Save as" when you simply save a file

  • Could not open the dialog box of .msi files saying find a program to open the file type

    In time, I used msi files to install many programs. But I know longer really since then, msi files could not open. Now, I can't open the msi installer, which I had used to install programs. When I click on the msi file, it displays a dialog box saying find a program to open the file type.

    Hello

    1. Were there some recent changes to the computer before the show?

    Method 1: I suggest you unregister and re - register the windows setup program and check if that helps you. To do this, please follow the steps below:

    Unregister and register the Windows Setup program again

    (a) click Start, click run and then type cmd in the dialog box, and then click command prompt.

    (b) at the command prompt, type the following and press ENTER after each line:

    MSIExec /Unregister

    MSIExec/regserver

    Method 2: When you run an .exe on a Windows XP, Windows Vista or Windows 7 computer file, the file can start another program.

    http://support.Microsoft.com/kb/950505/

    Method 3: Change default programs using Set Program Access and computer defaults:
    http://Windows.Microsoft.com/en-us/Windows7/change-default-programs-using-set-program-access-and-computer-defaults

    Changing the programs Windows uses by default: http://windows.microsoft.com/en-US/windows7/Change-which-programs-Windows-uses-by-default

    Hope this information is useful.

  • MenuItem to FileExplorer could not open the dialog box or PopupScreen.

    Hello

    I would like to know why I can't open a dialog box or a menuitem PopupScreen in file Explorer.

    The use of the debugger I see that there is no ancestral error and execution to get there in the Dialog.alert("").

    is there a solution?

    See this article.

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

  • By clicking on "remove properties and personal information" does not open the dialog box 'properties to remove.

    Hi all!  I'm new here.  Hope someone could help me with my problem.  I'm using Windows 7 Home Basic x 64.

    For any file that I did a right click to view properties--> select Details tab--> click on "remove properties and personal information. I do not see the Remove Properties dialog box will appear. Instead, refreshes just the Properties window. I restarted my laptop already, but the bug does not go far.  Tried to ask for help from my laptop to the manufacturer and they told me to reinstall the OS, I did.  But the bug is still there.

    Could this be something to do with my registry?  Tried searching solutions in other forums / Speakup, but found none.  Would really appreciate your help.  :)

    Right, I've now solved my problem.  Somehow, obtained data stripped of these two keys:

    HKEY_CLASSES_ROOT\ * \shell\removeproperties
    HKEY_CLASSES_ROOT\ * \shell\removeproperties\DropTarget
    Those who have problems with the "Remove properties" dialog box might try to check these keys, which must contain the following data:
     
    [HKEY_CLASSES_ROOT\ * \shell\removeproperties]
    "ProgrammaticAccessOnly"="Apartment".
     
    [HKEY_CLASSES_ROOT\ * \shell\removeproperties\DropTarget]
    "CLSID" = "{09a28848-0e97-4cef-b950-cea037161155}".
  • Script multi coding insert in the dialog box

    Dear friends,

    I was trying to script for "Multi script coding to add to the unique script". I need to use the dialog box. Since then I made dialog box encoding (see my code below).

    But I did not now how to add multi script coding in the dialog box on the inside?

    My requirement: I want to select a box of a script. I need to run that select only script code. Otherwise, another script code required to run no..

    Example:

    1. I chose 1 '01_Overrodes' script, I just run this script only.
    2. I chose 2 script "02_FindText", just I want to run this script only.
    3. I chose 3 script "replace 03_Alert_Basic" I want to just run this script only.

    Screen Shot 2016-04-28 at 3.40.40 PM.png

    var  
      w=new Window("dialog", "Action List"),  
      radio=w.add("panel", undefined, "Choose Action"),  
      option1=radio.add("radiobutton", undefined, "01_Overrodes"),  
      option2=radio.add("radiobutton", undefined, "02_FindText"),  
      option3=radio.add("radiobutton", undefined, "03_Alert_Basic Replace"),  
      option4=radio.add("radiobutton", undefined, "04_Tracking, Kerning and Nonbreak");    
      option5=radio.add("radiobutton", undefined, "05_Colour Remove");    
      option6=radio.add("radiobutton", undefined, "06_Foilo order");    
      
      w.add ("button", undefined, "OK") 
      option1.value = true;    
        radio.alignChildren="left";    
        radio.margins = [10,10,50,10];  
      
      
    
    
    //where is i add my coding
    
      
      
    if (w.show() == 1){      
         if (option1.value) alert("Action One!");  
         if (option2.value) alert("Action Two!");  
      if (option3.value) alert("Action Three!");  
      if (option4.value) alert("Action Four!");
      if (option5.value) alert("Action Four!");
      if (option6.value) alert("Action Four!");
        }    
    else {      
        exit();      
        };  
    
    
    
    var  
    

    Please help and suggest me friends.

    Thanks in advance

    Hello Kitty,

    You can use it like that too,

    var

    w = new window ('dialogue', "Action List"),

    Radio is w.Add ('Committee', undefined, "choose the Action").

    option1 = radio. Add ('radiobutton', undefined, "01_Overrodes"),

    option2 = radio. Add ('radiobutton', undefined, "02_FindText"),

    Option3 = radio. Add ('radiobutton', undefined, "replace 03_Alert_Basic"),

    option4 = radio. Add ('radiobutton', undefined, ' 04_Tracking, kerning and Nonbreak");

    Option5 = radio. Add ('radiobutton', undefined, "remove 05_Colour");

    option6 = radio. Add ('radiobutton', undefined, "order 06_Foilo");

    w.Add ("button", undefined, 'OK')

    option1. Value = true;

    radio.alignChildren = "left";

    radio. Margins = [10,10,50,10];

    If (w.show () == 1) {}

    If (option1.value) {((Folder.desktop+"/0/01_Overrodes.jsx") leader, ScriptLanguage.ja vascript) app.doScript};

    If (option2.value) {((Folder.desktop+"/0/02_FindText.jsx") leader, ScriptLanguage.jav ascript) app.doScript};

    If (option3.value) {app.doScript (File (Folder.desktop+"/0/03_Alert_Basic Format.jsx"), ScriptLanguage.javascript)};

    If (option4.value) {app.doScript (leader (Folder.desktop + ' "/ 0/04_Tracking, kerning, and Nonbreak.jsx" '), ScriptLanguage.javascript)};

    If (option5.value) {app.doScript (File (Folder.desktop+"/0/05_Colour Remove.jsx"), ScriptLanguage.javascript)};

    If (option6.value) {app.doScript (leader (Folder.desktop+"/0/06_Foilo order.jsx)", ScriptLanguage.javascript)};

    }

    else {}

    Exit();

    };

  • ScriptUI run the script in the button of the dialog box

    Here's what I have right now.  It's a little awkward in the way it works, and I just have a little smoother.

    I have a script at startup which creates a Menu item with a submenu of the menu item drop-down. When you click the submenu item, it runs a script.

    The first thing the script is pop up a message box that tells them that two dialog boxes go to the pop-up window. One by asking them to choose the location of an xml file and the second dialog box that ask them to choose the location of their folder of images.  After you finish choose their folder in the second dialog box, the script takes these two values, makes variable and continues to run the rest of the script.

    Here's what I would...

    1. open a window for dialogue with two input fields, both 'Browse' buttons and OK and CANCEL buttons

    2. When you click Browse next to the first input box for the first button, it will open a file dialog window.  You select your file and the file string will populate the input field

    3. When you click on the second button next to the second entry field, it opens a file dialog window.  You select the file and the string fills the second input field.

    4. When you click OK, it nurtures values in the input to a script fields.

    I already have scripts which opens the dialog for file and folder boxes, but what I can't understand how the is to start and run a script to a button press, in this case, when you press the OK button.  It's probably an onClick, but I was not able to find examples of what would be the syntax.

    Is the closest I found in the beginning ScriptUI document that was on the site of Jongware, in the section on Communication between the windows.  But each window opens with a different scenario and is not using a button to call a script.

    As always, any point in the right direction is much appreciated. Thank you.

    ScriptUI windows and JS file dialog boxes are not communucate. To get a return value in a file dialog box, you would do something like this:

    myFile = file (myFolder) .openDlg ("select files");

    If (myFile = null)

    back, do nothing

    The JavaScript Tools Guide CSx (see the Help menu on the ESTK) documents several dialogues selection of files and folders.

    Peter

  • How can I configure the dialog box open to show details by default?

    By default, the open dialog box always opens in list view. I want that it is displayed in the details view and I want to rearrange the columns as well.

    Is it possible to change the default layout of the open dialog boxes in Windows? I expected to work like the Windows Explorer, but it does not work.

    It should do, in fact.  I just tested here with Notepad.

    1. Open Notepad and click file/open
    2. Change the style or the size of the icons (I put it "Extra large icons")
    3. Clicked on cancel
    4. File/open again and I have observed that the icons were always great like last time.  I changed them will be list.
    5. I closed and opened the dialog box "Open" once more and has pointed out that the icons are still in list view.

    Given this test, I think that it must be based on the program that you are using.

  • Report opens in the dialog box, on the client.

    Hello

    I use 11.1.2.1.0 Builder, and I'll call you a form report.

    If I run/call report on my pc it opens perfectly in the browser (pdf format), but if the same report opens on the client pc, it opens the dialog box save as and request the user to save the report.

    Can you please let me know, how can I achieve to open a report in the browser on the pc of the client, without saving it in the logon dialog.

    Looking forward to your answers.

    Kind regards

    It is probably because the browser does not support opening a pdf document.

    Most browsers support pdf, some need a plugin. Check what is happening with any other pdf document on the web you want to open on PC of the user, as http://docs.oracle.com/cd/E16655_01/server.121/e17643.pdf

  • Open/Save dialog box as in Windows 7 appear not

    Hello

    I have an intermittent problem with Windows 7.  I tend to keep the programs up and running for weeks, because every day instead of shutting down the computer, I put on standby.  The problem is, after a few weeks to go in and out of sleep, the open/save as box stops in programs which were broadcast during weeks of dialogue.  Here is an example:

    I open word, excel, firefox, January 1.  I opened random documents by clicking through Explorer or just browse the web.  But I never completely close all programs.  I could open up doc1, doc2, doc3, doc1 close, open doc4, narrow doc2, etc..  All programs stay in memory.  After a few weeks, said Jan 28, if I select file-> open, the dialog box is not pop up.  I can open via the documents Explorer, but no file-> open.  Also, I can't make a file-> save as.  I can do-> file save (saves the document), but nothing that causes the dialog box.  It is reproducible in word, excel, firefox, or any other program, I leave the door open for several weeks.

    Here's the weird second problem.  Say I got word, excel, and firefox open for weeks.  If I exit excel completely, and then restart, the dialog box continues to work in excel.  But it remains broken in word and firefox.

    Everyone race in this issue?  Somehow I can fix this without having to restart the program?  The main reason, it's a problem for me is because I do not often know that this problem occurred.  Hopefully, I'll open a spreadsheet from a web page and start editing.  I try to do a save as, only to find the pop dialog box - up will not appear and I can't save the work I do.  Or I have a word document open for weeks.  I usually just hit the Save button, but this time I want to save it under a different name.  I can't do it while this problem is here and I have to close microsoft word completely to get the box to start working again.

    Thanks for your help!

    Hello

    The key is that every so often, you have to restart things, windows programs, the computer itself, in order clearly to all the memory, unload all managers, the .dll files - indeed clear the cobwebs from the computer. If you do not, you can continue to run into the problem you describe.

    For my part, even if I do not turn off my computer, I restart from time to time to get a fresh start, for me, that means being able to have all the features with drag-and-drop processes; for you, this is the Save as dialogue box.

    Nothing else to do.

    Kind regards

    BearPup

  • Open the dialog through PJC

    Hi all

    y at - it a demo of CCP to open the dialog box?

    Yes, this one


    François

  • excerpt from script to open the file info dialog box?

    is it possible to have a script, open the dialog "file info" and then just end (leave the dialog box open) so that the user can enter any information of metatag?

    This appears to do:

    app.menuActions.itemByID (75265) .invoke)

    But this seems to do too:

    app.menuActions.itemByID (89092) .invoke)

    Not really sure what is the difference, but it is without a doubt one

    difference, so check it out carefully. If you find something, after return!

  • Edit Script add images removed from the dialog box

    Hello guys! Years I am looking for a script that automates the creation of diagrams of my albums add moroccoin mascaras from Adobe Bridge and my luck are the 'add images' problem is that it always opens a dialog box with four options, I would like to run the direct command with the first two options enabled without the dialog box.

    imagem add pics.jpg

    I made the changes and you can download the file changed from here...

    Wikisend: free file-sharing service

Maybe you are looking for