Methods to Insert File name

File name completion or insertion in FireCMD shell can be done in four ways:

  1. Using context menu
  2. Using command substitution and openfile command
  3. Using command substitution and savefile command
  4. Using command substitution and pathc command

Using context menu

Simply right click and from the context menu that appears, select Insert Filename. This will open Open File dialog which will allow you to insert a file path. Note that the file path will be enclosed within double quotes. This method also works in terminal emulator i.e. you can also use the context menu to insert file paths in other console programs and shells such as command prompt, PowerShell etc.

Using command substitution and openfile command

The disadvantage of the first method i.e. using context menu is that it is not compatible with alias. To overcome this limitation, command substitution and openfile command can be used together to insert an absolute file name in the command line and moreover the command line can be given an alias. For example using open, openfile and command subtitution we can create an alias (say open2) which allows user to open any file using the Open File dialog. The command line to create such an alias named open2 is as follows:

alias open2 open +|openfile|

After creating the above mentioned alias, you can simply type open2, press enter and select a file in Open File dialog box which has to be opened.

Using command substitution and savefile command

This method is similar to the second method described above. The only difference is, a Save File dialog is shown instead of Open File dialog. An example is shown below:

alias createfile edit +|savefile "Create File in FireTXT"|

After creating the above mentioned alias, you can simply type createfile, press enter and give a file name in Save File dialog box which has to be created in FireTXT text editor.

Using command substitution and pathc command

We can also use the pathc with command substitution. When the user starts typing the file path, it suggests path elements which can be used to complete the absolute file name. Note that pathc command does not limit the path auto-completion to file paths and also shows the directory names.

Example: open +|pathc "Enter file path and click on OK button"|