# External Tools

You can add items to the Tools menu that allow you to launch external tools from within Ini Translator. For example, you can add an item to the Tools menu to launch utilities such as Character Map or Notepad. You can even add commands to open webpages or e-mail clients.

The External Tools dialog is available from the Tools-Customize menu:

Menu contents
  Lists the titles of the items currently added to the Tools menu. Use the Move up and Move down buttons to change the order of the items that appear on the menu. Use the Delete button to remove an item from the menu. Use Add to add a new item to the list.
Move up
  Moves the selected tool higher in the list.
Move down
  Moves the selected tool lower in the list.
Add
  Clears the text boxes so you can specify a new tool.
Delete
  Removes the tool or command from the Menu contents list as well as from the Tools menu.
Title
  The name of the tool or command that will appear on the submenu of the Tools menu. Place an ampersand before a letter in the name of the tool to use that letter as an accelerator key for the tool. For example, `&Notepad` would display Notepad on the Tools menu.
Command
  Specifies the path to the .exe, .com, .pif, .bat, .cmd, or other file that you intend to launch. Do not enter command-line switches or arguments here.
Arguments
  Specifies the variables that are passed to the tool when the tool is selected on the menu. Arguments can specify values that are passed to the tool or command when it is launched. For example, a value can specify a filename or directory. Use the Arrow button to select from a list of predefined arguments. You can add more than one. For a complete list of predefined arguments and their definitions, see below. You can also enter custom arguments — command line switches, for example — depending on the command or tool you use.
Initial directory
  Specifies the working directory of the tool. Use the Arrow button to select directories. You can select more than one.
Shortcut Key
  Specifies the shortcut key used to invoke the tool. Press the shortcut key combination when the shortcut key edit field has the focus to assign a new shortcut to the selected tool. If the assigned shortcut is already in use anywhere else in the program, the tool item is displayed enclosed in !> and <!. For an example, see the Character Map tool in the image above: it has the same shortcut key as the Copy from Name menu item. To remove a shortcut key, either press the backspace key or click the Clear button.
Use ShellExecute
  Some tools works better when run using the ShellExecute API function. It's not easy to specify any rule for this, so you will have to use trial and error to find the best way to launch an application. Note that when using ShellExecute, Wait for completion is disabled.
Prompt for arguments
  Displays the Arguments dialog box to allow you to enter or edit values for the arguments each time you launch the external tool.
Wait for completion
  Specifies whether Ini Translator should wait for the tool to close before returning. This is useful if the tool processes one of the files currently loaded in Ini Translator and you need to wait until the tool has finished with it. Note that most standard Windows programs actually return immediately, but most command line tools do not.
Test
  Click the Test button to test the currently selected tool item without having to close the dialog. This can significantly speed up the process of configuring a tool correctly.

Predefined Arguments

The following predefined arguments are available from the Arrow menus (not all arguments are available everywhere) :

Name | Argument | Description
--- | --- | ---
Original Line | $(OrigLine) | The entire text of the current original item
Original Text | $(OrigText) | The selected text of the current original item
Original Path | $(OrigPath) | Full path and filename of the current original file
Original Directory | $(OrigDir) | Path of the current original file
Original Name | $(OrigName) | Filename of the current original file, without path
Original Extension | $(OrigExt) | File extension of the current original file, including leading dot
Translation Line | $(TransLine) | The entire text of the current translation item
Translation Text | $(TransText) | The selected text of the current translation item
Translation Path | $(TransPath) | Full path and filename of the current translation file
Translation Directory | $(TransDir) | Path of the current translation file
Translation Name | $(TransName) | Filename of the current translation file, without path
Translation Extension | $(TransExt) | File extension of the current translation file, including leading dot
Dictionary Path | $(DictPath) | Full path and filename of the current dictionary file
Dictionary Directory | $(DictDir) | Path of the current dictionary file
Dictionary Name | $(DictName) | Filename of the current dictionary file, without path
Dictionary Extension | $(DictExt) | File extension of the current original file, including leading dot
Application Directory | $(AppDir) | Path to the Ini Translator application
Windows Directory | $(WinDir) | Path to the Windows folder
System Directory | $(SysDir) | Path to the Windows System folder

Tip:

If you want to see the resulting command-line without executing the tool, temporarily enable Prompt for Arguments and then click the Test button. The prompt dialog is shown, displaying the command-line that will be executed. Click the Cancel button to close the prompt dialog without executing the tool. When finished, disable the Prompt for Arguments option again.