Asked • 03/18/19

Adobe InDesign CS6 "undefined is not an object"?

I am new to InDesign scripting though I do have experience with Javascript. I created a new menu item as you will see in the script below, which I planned to use it to call another script onclick. However I am facing some issues, so I decided to delete the menu item and start over. But at line 10, I get the message "undefined is not an object", which I can't figure out why it's causing a problem. Any help will be appreciated. //#targetengine "ImportFolder" //var myMainMenu = app.menus.item("Main"); //var myCustomMenu = myMainMenu.submenus.item("Import Folder"); //var myCustomMenu = myMainMenu.submenus.add("Import Folder"); //var mySampleScriptAction = app.scriptMenuActions.add("onInvoke", function() { //app.doScript(new File ("/C/Program Files (x86)/Adobe/Adobe InDesign CS6/Scripts/Scripts Panel/importFiles.jsx" ));}); //delete the menu var myMainMenu = app.menus.item("Main"); try{ var myCustomMenu = myMainMenu.submenus.item("Import Folder"); myCustomMenu.remove(); }catch(myError){}

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.