/save

Usage:

/SAVE [-a] file [list-options]


Saves specified macros to file. The list-options are the same as those in the /list command; see "/list" for details. Invisible macros will not be saved unless "-i" is specified.

If "-a" is specified, macros will be appended to file. Otherwise, the macros will overwrite any existing contents of file.

The return value of /save is the number of the last macro listed, or 0 if no macros were listed (because of error or none matched the specified options).

The standard macro library also defines commands that save macros of a particular type:

/savedef
macros with names, but no triggers, hooks, or keybindings
/savebind
macros with keybindings
/savehilite
macros with triggers and attributes other than -ag
/savegag
macros with triggers and the -ag attribute
/savetrig
macros with triggers and no attributes
/savehook
macros with hooks
These commands take a filename argument; if it is omitted, a default file name will be used. No -a (append) option is allowed.

The /save* commands are useful if your macros are few and simple, but if you have many and/or complex macros, you will probably find it easier to write them with an editor and then /load them in tf, instead of writing them in tf and /save'ing them to a file. Avoiding /save allows you to keep the file(s) nicely formatted, use comments, and organize them better. Use whatever works best for you.

Note that when tf starts, it does not automatically read files created with any of the /save commands. To make it do so, add the corresponding /load command to your .tfrc file.

Except for its return value,
/save [-a] file [list-options]
is equivalent to
/eval /list [list-options] %| /writefile [-a] file

See: macros, patterns, attributes, library, /def, /list, /load, /saveworld


Back to index
Back to tf home page
Copyright © 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004, 2005, 2006-2007 Ken Keys