Please enable JavaScript to view this site.

CopiaFacts™ Reference

Editor for CopiaFacts command files

CopiaEdit [filename]

COPIAEDIT is a simple (Notepad-like) text editor designed for use with Copia command files.  It has a syntax-highlighting feature which shows command keywords in bold font, and also includes integrated help. It supports CFG, USR, UJP, FS, IIF, GCT, MBX, and MCF files, but can also be used for other text file types.

To display help for a CopiaFacts command, either press F1 with the cursor on the command text, or double-click the bold command. This will open the reference page for the command in COPIAFACTS.CHM.  This help file must be in the same folder as COPIAEDIT.EXE.  A help page which lists all the available commands for the current file type is also available from the help menu.

COPIAEDIT loads files with any supported encoding but always saves CopiaFacts command files with the encoding specified by the $unicode commands in FAXFACTS.CFG. If you edit FAXFACTS.CFG and change its own encoding, it will be saved with the new encoding.  The menus and title bar display the encoding.

For files with extensions other than CopiaFacts command files and INI files, the CP_COPIAEDIT configuration file variable allows you to specify automatic encoding detection parameters, which can then be enabled, for loading non-command files, from the Options menu.  Such files can also be saved with non-standard encodings: an analysis of the text will offer available supported encodings, if any, on the Edit menu. The new encoding is then applied when the file is saved.

COPIAEDIT also handles INI files (but without the 'help' function) and can in fact be used to edit any text file (without the syntax-highlighting).

COPIAEDIT also includes undo/redo and printing capability, and can also auto-indent (from the edit menu) conditional commands in a command file.  A backup is made using a file extension with a leading tilde (e.g. .~ext) unless this is suppressed from the Options menu.  

When editing an infobox (IIF) file, if the first command is $authenticate, a password will be requested.  For more information on authentication, see Encrypted Variables.

Special Editor Functions

With the cursor on a 'word' or number, or on highlighted text, you can hold down the Control and Alt keys and then press Up-Arrow or Down-Arrow to navigate to the previous or next occurrence of the same text in the file.  Release the Control or Alt key to end this operation.

With the cursor on a conditional command $if or $endif you can hold down the Control and Alt keys and then press Right-Arrow to move to the matching $endif or $if command respectively.  Release the Control or Alt key to end this operation.  This feature can also be used with $ifn, $ife, and $ifne commands.

The F9 key can be used to auto-indent a CopiaFacts command file.

The find (control-F) and replace (control-R) dialogs have two extra buttons in the edit field where you enter find and replace text.  The button at the left will paste the current clipboard content into the field, and that on the right will display a list of the recent find and replace text entered.  These two lists are shared across the uses of the syntax-highlight editor when it is embedded in other CopiaFacts applications. Up to 16 entries are saved for each field.

When the syntax-highlight editor is in use, F3 and shift-F3 can be used to find the next or previous occurrence of the last find text found in the same application., if any.

Opening a file named in the text

If you highlight a file name or path name in the editor and right-click it, then if the file can be found, clicking a pop-up menu item will allow you to view the file.  The selected text may optionally include double-quotes, and if a supported file name is enclosed in double-quotes, then double-clicking anywhere between the double-quotes will in most editor dialogs cause the file to be opened, even though blanks in the filename may cause the editor not to highlight the whole name.  If the file is not found or not supported, nothing happens.

For files such as PDF or DOC an appropriate application must be registered to process the view. File names of CopiaFacts command files without a path element are searched for in the appropriate locations: for example an FS file is searched for in SENT, FAIL, PREPROC, POSTPROC and all the configured TOSEND folders. Filename variables such as @FFBASE are expanded if present.

The following file extensions are supported: CFG, USR, UJP, FS, MCX, MCF, IIF, GCT, GTT, GPT, TR?, FT?, GW?, DOC, DOCX, XLS, XLSX, XLSM, PPT, PPTX, TIF, TAB, HTM, HTML.

If a file name has no extension and is enclosed in {} characters (as in a COPIAFACTS trace file) it is assumed to be an FS file name, unless it is of the form {I:nnnnnnnn} in which case it would be assumed to be an infobox filename.  To find an IIF file, CFG file $script_locn commands and those in the default USR file, if found, are used: of course the latter may not be the user profile in use at the time that the infobox name was written to a trace file.

The syntax-highlighting editor of COPIAEDIT is also embedded in various other CopiaFacts programs, including GWMANAGER, JOBADMIN, and STATUS, and the same facilities for opening files are available in these programs there.  In COPIAFACTS on the Scrollback tab you can right-click in the middle of a file name path name (the path name cannot be highlighted), and in TRCVIEW you can select and right-click a file name or path name in the pop-up window which appears if you right-click a trace line.

If you see blank red characters in the text, this means that you have text (probably originating from an HTML original, or from an Excel spreadsheet) containing 'non-breaking space Unicode characters (U00A0). They will usually cause rejection in CopiaFacts command files and should be changed to normal space characters.

In all cases, if the selected item cannot be resolved as a file name or path name, or if the file is not found, then the menu item to open it does not appear. If this would be the only item in the right-click menu, then no menu pop-up will occur.

Updating Copia Standard Scripts

Sometimes, changes or corrections to standard scripts or other sample files are installed in a CopiaFacts update.  Your working copies of these files are never updated, in case you have modified or customized them; instead the new file is written to the FAXFACTS\SAMPLES\ScriptMasterCopies folder.  The installer creates a list of changed files in CHANGEDFILES.TXT in the same folder.

COPIAEDIT now uses this list of updated files to determine if a new master copy of a file you open has been installed.  If you open your working copy of one of these files from its standard install location, a dialog will be displayed inviting you to apply the changes to your own copy of the file.:

When there are new files in the ScriptMasterCopies folder, COPIAEDIT will also list them in a new Open submenu.  Saving your working file, either without or after applying changes, will remove its entry from the list of changed "master copies":

In the difference viewer the new master copy will be shown on the left and your current script will be shown on the right, with differences highlighted.  

To replace your working file completely with the new master copy, click the left button.  You can also control-click this button to replace the file, save it, and close COPIAEDIT.

You can also select a set of one or more contiguous lines on the left to be copied to the clipboard when you close the difference viewer.  The selected lines will be shown in bold so that the color-coding remains visible.

When you return to the editor the cursor will be is positioned at the same location in your existing script file, ready to select the old text and paste over it. If you have selected all the text on the left side, you can 'select all' on return using the short-cut Control-L.

Whenever a file loaded into COPIAEDIT has a matching file in ScriptMasterCopies, a new menu item is available in the main editor, to allow the differences to be viewed.  The right side of the difference viewer will reflect your changes even if they have not yet been saved.