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 Objects 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, Settings, 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/lorenz.praat"

Usage convention

Please adhere to the convention that commands 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. It has the exact same list of parameters.

Links to this page


© Paul Boersma 1997,2002,2005,2006,2012,2014,2023