Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

Moving menu commands

$
0
0

Has anyone had success adding custom commands to FrameMaker menus and then moving them to different locations on the menu? I can do this with the FDK and FrameScript but I haven't had success with ExtendScript. I am defining a custom command and adding it to the File menu. I want to move it up under the Save As XML command. Here is what I am using:

 

#target framemaker

var menu, cmd, saveCmd;

// Get the File menu.
menu = app.GetNamedMenu ("FileMenu");

// Create the command and add it to the File menu.
cmd = menu.DefineAndAddCommand (10, "SaveAsPdfQuickCmd", "Save As PDF Quick","");
cmd.EnabledWhen = Constants.FV_ENABLE_NEEDS_DOCP_ONLY;

// Move the command up in the menu.
saveCmd = app.GetNamedCommand ("SaveAsXml");
cmd.PrevMenuItemInMenu = saveCmd;

// must call if script has been run through ESTK, redundant otherwise.
UpdateMenus ();

 

The custom command gets added to the File menu, but it stays at the bottom of the menu. Any help would be appreciated. Thanks.

-Rick


Viewing all articles
Browse latest Browse all 888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>