0 Replies Latest reply on Nov 6, 2009 12:11 PM by C_T_P_Roake

    Problem running sample script GetMenuNames.jsx in InDesign CS4

    C_T_P_Roake Level 1

      Hi.  I'm trying to learn scripting in InDesign, and I'm reading the manual, and trying out the sample scripts as they are referenced in the manual.  I am reading the chapter on Menus (Chapter 8) in "Adobe InDesign CS4 Scripting Guide: JavaScript".  The first sample script GetMenuActions.jsx ran just fine, and now I am trying to run the second, GetMenuNames.jsx


      When I run the script, I get the following error:


      JavaScript Error!


      Error Number: 26

      Error String: Submenu.getElements() cannot work with instances of this class


      File: <long pathname here>\GetMenuNames.jsx

      Line: 48

      Source:    if(myMenuElement.getElements()[0].constructor.name == "Submenu"){



      I am running Adobe InDesign CS4 version 6.0.4 under Windows XP SP3 (32-bit).


      I downloaded the sample scripts from Adobe's website, so it isn't a problem of my mistyping.  Has anyone else succeeded in running this script?  Am I doing something wrong?  Can anyone offer suggestions on how to make it work?