
586
ADOBE FRAMEMAKER SCRIPTING GUIDE
Function Summary
Last updated 9/26/2011
AddCommandToMenu
Description
Adds a FrameMaker product command or a client-defined command to a menu.
AddCommandToMenu()
adds the command at the bottom of the specified menu. To change a command’s position on
a menu, set its
PrevMenuItemInMenu
and
NextMenuItemInMenu
properties.
To add a command that you have created, set the
command
parameter to the object returned by the
DefineCommand()
call that created the command.To add a FrameMaker product command, you must get its object. To get its object, call
GetNamedObject()
with the
objectName
parameter set to its name.
The method returns the command, on success.
On failure, the method returns one of the following values to
FA_errno
:
Returns
number
Syntax
AddCommandToMenu(command)
Parameters
AddMenuToMenu
Description
Adds a FrameMaker product menu or a menu that you have created to another menu or menu bar.
To add a menu to one of FrameMaker menus or menu bars, you must get the menu or menu bar’s object. To get its
object, call
GetNamedObject()
with the
objectName
parameter set to its name.
Note:
Your menu appears only on the menu bar you specify. For example, if you only add a menu to the
!MakerMainMenu
menu bar, the menu will not appear if the user switches to quick menus. For your menu to appear after the user has
switched to quick menus, you must also add it to
!QuickMakerMainMenu
.
The following table lists the types of menus you can add a menu to and how FrameMaker implements the added menu.
Error
Reason
Constants.FE_WrongProduct (-60)
Current FrameMaker product does not support this operation or
fmbatch
is running.
Constants.FE_BadOperation (-27)
Parameters specified an invalid operation.
Constants.FE_NotCommand (-73)
The
command
paramter did not specify a command.
Constants.FE_NotMenu (-72)
The specified menu does not exist.
Constants.FE_BadParameter (-43)
The specified parameter has an invalid value.
Constants.FE_SystemError (-42)
System Error
Parameter name
Data Type
Optional
Description
command
Command
No
The command to add.