When new editor window is launched (but before the document is loaded or created),
file init.qs
from application's data directory is run, then
file userinit.qs
from users's application configuration
directory (which is $HOME/.pdfedit
) is run, if it exists
[2]
.
These files should contain declaration of all functions used in toolbars
or menus and may also contain any startup code to be run
before loading or creating new document.
In commandline mode, file init_console.qs
from application's data
directory is run instead, then file userinit_console.qs
from users's
application configuration directory (which is $HOME/.pdfedit
)
is run, if it exists [2]
After running these init scripts, any "plugin" scripts from directories specified in configuration are run. By default, these directories are:
Directory scripts
in application's data directory
Directory scripts
in application's binary directory
Directory ./pdfedit/scripts
in user's home directory
For "plugin scripts" in commandline mode, scripts are searched in console
subdirectory of above directories instead.
Scripts are run in alphabetical order (by their filename, case sensitive) and if the same script is encountered in more than one directory, only the one in directory later in list is executed. This ensures that if user install newer version of some script in his home directory, only his version will get executed.
After that, the document is loaded (if it was not specified on commandline, the window will be initially empty without any document)
[2] This is in default configuration and it can be changed by user to different filename(s) in settings