PPTools/Guiguts/Guiguts 2 Manual/Custom Menu

From DPWiki
Jump to navigation Jump to search


GUIGUTS VERSION 2 MANUAL

Describes features included in release 2.0.3 (September 2025)


Custom Menu

Custom Menu
Custom Menu

The Custom Menu is entirely under your control, and lets you run programs and web tools that are beyond Guiguts' scope. The list above is the default one, but you are likely to add, delete, and rearrange it as time goes by.

Customizing the Custom Menu

(That's why it's named that way.)

To configure the menu, click Custom>Set External Programs. The following large dialog opens:

Customize Dialog

Each row of the table at the top corresponds to one Custom menu choice. The text of the menu item is on the left, and the command to execute is on the right. You can select a custom command in the table and perform various operations using the buttons below.

  • Move Up & Move Down move the selected command up or down in the menu, to reorder it.
  • Add Entry adds the Label and Command in the field above as a new entry in the menu.
  • Update Entry updates the selected entry with the new label or command you have typed in the fields above.
  • Remove Entry removes the selected entry from the menu.


Instructions for composing commands are shown at the bottom: you can use symbols or variables that Guiguts will values as described below:

$f The full pathname of the current File
$p The Page-image number currently shown in the status bar, e.g. "007" for "007.png"
$s The Sequence number of the current page, e.g. "7" for the 7th page regardless of png file names or page labels. Can also be offset using $(s+5) for example.
$t The currently selected word or words, stripped of any HTML tags (only the first line if it's a column selection)
$u The Unicode codepoint of the current character as shown in the status bar, e.g. "0041" for capital A.

The $s variable is useful for displaying the source scans at the Internet Archive or Hathi Trust, e.g.
https://archive.org/details/americanlacelace0000vand/page/n$(s+3)/mode/1up
https://babel.hathitrust.org/cgi/pt?id=hvd.hn1kpv&seq=$(s+11)

The $t variable is useful for looking up a selected word in your favorite online dictionary, e.g.
https://www.merriam-webster.com/dictionary/$t

The $u variable is useful for displaying information about Unicode characters, e.g.
https://www.unicodeplus.com/U+$u
https://www.fileformat.info/info/unicode/char/$u/index.htm


Windows Commands

The first part of an external command must specify an executable program or the word start. This special word will open any file or URL using the default handler on your system. If the command just consists of a URL, there is no need to include start - Guiguts will add that for you.

The command can be used in the following ways:

url Open url in default browser: https://validator.w3.org/
start file Open file in the handler for its file extension: start $f opens current file in default handler, e.g. Notepad for .txt.
start cmd parameters Start registered program cmd passing it the parameters: start firefox $f opens the current file in Firefox.

You'll need to use forward slashes in the file path, like this example:

ppgen start python.exe C:/DP/ppgen-gg2-json/ppgen.py -i $f -img

Linux and macOS Commands

The first part of an external command must specify an executable program or the word open. This special word will open any file or URL using the default handler on your system. If the command just consists of a URL, there is no need to include open - Guiguts will add that for you.

You may not need to specify the full path for programs that are located in directories listed in your $PATH variable, for example programs in /usr/bin. Test this with the which command in a terminal window. If which command produces a positive response, you may be able to use command without specifying its full path.

On macOS and some Linux systems, the open command has these forms:

url Open url in default browser: open https://validator.w3.org/
open file Open file in the handler for its file extension: open $f opens current file in the default handler, e.g. TextEdit for .txt on Macs.
open -a cmd parameters (macOS only) Start application cmd passing it the parameters: open -a bbedit $d$f$e, open -a preview $i$p.png, or open -a firefox $d$f$e

If you are using Linux, check to see if you have a command named open, and read its man page (man 1 open) to see how to use it. If your Linux does not have such a command, you need to use specific command names.