Add to fixed menu...

A command in the File menu of the ScriptEditor.

With this command, you add a button to any fixed menu in the Object window or in the Picture window. Clicking the added button will invoke the specified Praat script.

Settings

Window
the name of the window ("Objects" or "Picture") that contains the menu that you want to change.
Menu
the title of the menu that you want to change. If window is "Objects", you can specify the Praat, New, Open, Help, Goodies, Preferences, or Technical menu (for the Save menu, which depends on the objects selected, you would use Add to dynamic menu... instead). If window is "Picture", you can specify the File, Edit, Margins, World, Select, Pen, Font, or Help menu.
Command
the title of the new menu button. To get a separator line instead of a command text, you specify a unique string that starts with a hyphen ('-'); the ButtonEditor contains many examples of this.
After command
a button title in the menu or submenu after which you want your new button to be inserted. If you specify the empty string (""), your button will be put in the main menu.
Depth
0 if you want your button in the main menu, 1 if you want it in a submenu.
Script
the full path name of the script to invoke. If you saved the script you are editing, its name will already have been filled in here. If you do not specify a script, you will get a cascading menu title instead.

Example 1

In the Matrix submenu of the New menu, you want a separator line followed by the command "Peaks":

Add to fixed menu: "Objects", "New", "-- peaks --", "Create simple Matrix...", 1, ""
Add to fixed menu: "Objects", "New", "Peaks", "-- peaks --", 1, "/u/praats/demo/peaks.praat"

Example 2

In the New menu, you want a submenu called "Demo", with a subitem titled "Lorenz...":

Add to fixed menu: "Objects", "New", "Demo", "", 0,, ""
Add to fixed menu: "Objects", "New", "Lorenz...", "Demo", 1, "/u/praats/demo/lorentz.praat"

Usage convention

Please adhere to the convention that command that take arguments, such as "Lorenz..." above, end in three dots.

Using this command in a script

To add a fixed button from a script (perhaps your initialization script or a plug-in), use the hidden shell command Add menu command... instead.

Links to this page


© ppgb, January 7, 2014