Batch Mode Commands

This chapter describes the commands available in batch mode in Passolo. The syntax descriptions use square brackets [] to indicate optional parameters. Expressions in angle brackets <> are placeholders for text arguments.

Each command begins with a slash (/) or a minus sign (-). Subsequent expressions without a slash or minus sign are parameters of the preceding command. Parameter containing spaces have to be set in quotation marks ("my project.lpu").

You can enter multiple commands in one line, until the maximum length of a command line is reached. When entering numerous commands in sequence, use of the /script command is recommended.

/addlang

This command adds target languages to the current project. If the language you want to add already exists in the project, it will not be added again unless the ignoreexisting parameter is used.

Syntax
/addlang[:] [lang:] [ignoreexisting]
Parameters
lang:<languagename>Use this parameter to specify the new language. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). If only one language is added, the languagename parameter can be entered directly after the addlang command
ignoreexistingUse this parameter to add a language to the project even if it already exists as a target language.
Example
pslcmd c:\projects\myProject.lpu /addlang:"deu"
/addsource
This command adds source files to the current project. If the source file you want to add already exists in the project, it will not be added again unless the ignoreexisting parameter is used.
Syntax


/addsource[:] [sourcefile:] [sourcefilelist:] 
	

[sourcefolder:] [subfolders]
	

[sourcelang:] [parser:] [targetrule:]
	

[forcetargetrule:<name>] [ignoreexisting]

[virtualFolder:<foldername>]

Parameters
sourcefile:<filepath>Use this parameter to specify the new source file. You can use multiple sourcefile parameters in order to add further source files.
sourcefilelist:<filepath><filepath> is a text file containing a list of the source files to be added to the project.
sourcefolder:<folderpath>Use this parameter to specify a folder containing source files. All the files in this folder are added to the project. If the subfolders parameter is used, all the files contained in subfolders of the source folder are also added. If you specify a parser only files that have one of the filename extensions supported by the given parser will be added.
sourcelang:<languagename>Use this parameter to specify the language of the strings in the source files. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07"). (See Language IDs)
parser:<parser>Use this parameter to specify the parser to be used for the added source files. <parser> can be one of the following entries: Win32, AddIn:<identifier> or Macro:<filename> . The add-in identifiers are indicated in the Passolo add-in administration, e.g. Borland Delphi/C++ Builder or Microsoft .NET Parser. Please make sure that you type in the identifier correctly.
targetrule:<name>Use this parameter to specify the target rule to be used for the new source files. If you don't specify a rule, the standard rule is used. The parser of the source file can overwrite the specified rule.
forcetargetrule:<name>Use this parameter to specify the target rule you want to use for the new source files. The specified rule is also used, if the parser defines it's own target rule.
ignoreexistingUse this parameter to add a source file to the project even if it already exists.
virtualFolderUse this parameter to specify the path to a virtual folder structure. It will also create a virtual folder if there is none.
Example
This command adds all the Delphi programs in c:\sources to the project.
pslcmd c:\projects\myProject.lpu /addsource:c:\sources\*.exe "parser:Borland Delphi/C++ Builder"

/batch

This command is a combination of the /update and /generate commands. It updates the string lists and then generates the target files. Use the /source command to limit the operation to specified source files.

This command ensures compatibility with previous versions of Passolo. Current batch files should make use of the /update and /generate commands.

Syntax
/batch
Parameters
<none>
Example
This command updates all the string lists of a project and generates the target files
psl c:\projects\myProject.lpu /batch

/check

This command performs a validation of text lists.

Syntax
/check [source:<Title>] [sourcefile:<File Path>]

[nosource] [lang:<languagename>] [notrans] [id:<id>]
Parameters
source:<title>This parameter specifies a source string list to be updated (based on the title). If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked.
sourcefile:<filepath>This parameter specifies a source string list to be updated (based on the file path). If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked.
nosourceUse this parameter to prevent source string list checks.
lang:<languagename>If you specify a language, all translation string lists in this language are checked. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07").
notransUse this parameter to prevent translation list checks.
id:<id>Use this parameter to specify the string list to be updated based on the ID. If this is a source string list and you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also checked.

/closeproject

This command closes the last opened project. This command should always be performed for each project when multiple projects are processed in a /script command.

Syntax
/closeproject
Example
Two projects are processed in a /script command and the first one is closed before starting with the second one. /openproject:c:\myFirstProject.lpu /update /closeproject /openproject:c:\mySecondProject.lpu /update

/generate

This command generates target files

Syntax
/generate [source:<title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<id>]

[altfile:<filepath>] [altfolder:<folderpath>] [subfolders] [vrtualFolder:<path>]
Parameters
source:<title>Use this parameter to specify a source file by means of its title. If you do not indicate a language, all the target files for this source file will be generated.
sourcefile:<filepath>Use this parameter to specify a source file based on its file path. If you do not indicate a language, all the target files for this source file will be generated.
lang:<languagename>If you indicate a language, only the target files for this language are generated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07").
id:<id>Use this parameter to specify a target file by means of the corresponding ID in the translation list.
altfile:<filepath>If you want to generate only one target file, you can specify an alternative path for the generated file.
altfolder:<folderpath>You can specify an alternative folder for the generated target file. Use the subfolders parameter to generate subfolders within this folder according to the folder structure of the target files defined in the project.
subfoldersSee altfolder parameter
ifrequiredIf this parameter is set, only the required target files are generated. I.e. the target files whose translation lists have been modified since the last generation.
virtualFolderUse this parameter to specify the path to a virtual folder structure. It will also create a virtual folder if there is none.
Example

This command generates all target files

psl c:\projects\myProject.lpu /generate

This command generates all target files for German

psl c:\projects\myProject.lpu /generate lang:German

/output

This command specifies a text file to which the Passolo messages generated during the batch operation are written.

Syntax
/output:<outputfile> [append] [open]
Parameters
appendIf you use this parameter, the output is appended to the existing output file. Otherwise the existing file is overwritten.
openAfter Passolo closes, the output file is displayed in Notepad.
Example
This command appends all messages to c:\output.txt.
pslcmd c:\projects\myProject.lpu /batch /output:c:\output.txt append

/openproject

This command opens an existing project. This command is not required if you specify the project before the first command. If a project is opened using /openproject, all subsequent commands in the batch file refer to this project.

Syntax
/openproject:<projectpath> [normal|convert | sharedSetup|sharedTranslate|sharedReadOnly]
Parameters
<projectpath>Path of the project to be opened. You can also type in the project name (without the path). In this case, Passolo will look for the project in the current directory and in the list of recently opened projects.
normalThis is the default mode. Only one user can open the project. He can modify all settings and data as needed.
convertThe project is converted to the latest installed version of Passolo.
sharedSetupThe project opens in Shared Mode. The user can modify project settings and edit string lists. Only one user at a time can work in this mode.
sharedTranslateThe project opens in Shared Mode. The user can edit string lists.
sharedReadOnlyThe project opens in Shared Mode. The user can view the string lists but cannot make changes.
Example
You are updating the string lists in two projects. The first project is loaded via the standard command line parameter, the second using the /openproject command.
psl c:\projects\myProject.lpu /update /openproject:c:\projects\anotherProject.lpu /update
/options
This command saves or loads an option profile.
Syntax
/options:<profilename> [load|save|temp] [content:<profilecontent>]
Parameters
<profilename>This parameter specifies the profile name or the path to the options file (see Setting Options)
loadThe options are loaded and saved persistently
saveThe current options are saved in the profile / the specified options file.
tempThe options are loaded temporarily. The are only used for the current batch operation.
contentOnly the specified options are saved or loaded. <profilecontent> is a comma-separated list of values corresponding to the pages of the Options dialog: view filter toolbars listops transdlg languages leverage pretrans fuzzy concordances terminology replicates assistant check spellcheck binaries simulation sytemmacro batch users system system2 folders If the parameter is missing all options are loaded or saved.
Example

The view and check options are saved to the myOptions profile

pslcmd /options:myOptions save content:view,check

/quit

Quits Passolo. Normally Passolo quits automatically after running the batch mode commands. /quit is used for commands that are also used as runtime parameter, for example /runmacro. Without /quit Passolo would start normally, not in batch mode.
Syntax
/quit
Example
pslcmd /runmacro=MyMacro.bas /quit
/runmacro
This command defines the macro that is started.
Syntax
/runmacro=<macro file>
Parameters
<macro file>This parameter specifies the name of the macro file. This macro must exist in the macro folder of Passolo. (See System Folder)
Example
pslcmd /runmacro=MyMacro.bas /quit

/simulate

This command generates a target file with simulated translations according to the current Simulation options. (see Simulation/Debug Dialog)
Syntax
/simulate [source:<title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<id>]

[altfile:<filepath>] [altfolder:<folderpath>] [subfolders]
Parameters
source:<title>Use this parameter to specify by title. If you do not indicate a language, all the target files for this source file will be generated.
sourcefile:<filepath>Use this parameter to specify a source file by file path. If you do not indicate a language, all the target files for this source file will be generated.
lang:<languagename>If you indicate a language, only the target files for this language are generated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07").
id:<id>Use this parameter to specify a target file by the corresponding ID in the translation list.
altfile:<filepath>If you want to generate only one target file, you can specify an alternative path for the generated file.
altfolder:<folderpath>You can specify an alternative folder for the generated target file. Use the subfolders parameter to generate subfolders within this folder according to the folder structure of the target files defined in the project.
subfolderssee altfolder parameter
storeUse this parameter to add a new target language to the project for the simulated translations. If the parameter store is indicated, the parameters altfile , altfolder and subfolders are ignored.
Example

This command generates simulated translations for all target files

pslcmd c:\projects\myProject.lpu /simulate

Generates simulated translations for all target files in German using the options from an options file.

pslcmd c:\projects\myProject.lpu /options:my_simulation_options temp /simulate lang:German

/newproject

This command sets up a new project. If the project already exists, it is opened similarly to /openproject.
Syntax
/newproject:<projectpath>
Parameters
<projectpath> 	Path of the project to be created
Example

This command sets up a new project and adds a source file

pslcmd /newproject:c:\projects\newProject.lpu /addsource sourcefile:c:\test\example.exe

/report

This command creates reports in defined locations.
Syntax
/report:%specificPath%
Parameter
%SpecificPath%Specifying a location parameter (-report:%SpecificPath%) creates the reports inside the specified folder.
No parameterThe -report command creates timestamped folders containing corresponding reports inside the Reports subfolder of the project directory.
Example
This command creates folders named with the current date and hour that contain report files inside the specified location.
pslcmd /report:%c:\projects\myProject%

/script

This command reads commands from a text file. The text file may contain any of the supported Passolo batch commands except for a further /script command. Lines beginning with a semicolon ; are regarded as comments and are ignored in batch processing.

Syntax
/script:<scriptfile>
Parameters
<scriptfile> 	Path to the script file
Example
This command executes all the commands in the file updateAll.txt.
pslcmd /script:c:\projects\updateAll.txt
/source
This command is used only in combination with the /batch command. It restricts the batch operations to the specified source file.
Syntax
/source
Parameters
<none>
Example

This command updates all the string lists for Notepad and generates the corresponding target files.

pslcmd c:\projects\myProject.lpu /batch /source:notepad
/synchronizeexports

Use this command with Collaboration Edition to synchronize the exported bundles from the configured FTP server with the current project. (see Synchronizing Translation Bundles)

The synchronization process consists of uploading a small bundle with differences to the FTP server and downloading new translations from the FTP server into the current project.

Syntax
/synchronizeexports 
Example

This command synchronizes the exported bundles with the project

pslcmd c:\projects\myProject.lpu /synchronizeexports
/translate

This command pre-translates with the current providers and options. See Options for Pre-Translation.

Syntax
/translate [source:<Title>] [sourcefile:<filepath>] [lang:<languagename>] [id:<ID>] 
Parameter
source:<Title>Use this parameter to specify a source list to be updated based on the title. If you do not specify a language, all associated translation string lists are translated.
sourcefile:Use this parameter to specify a source list to be updated based on the source file path. If you do not specify a language, all associated translation string lists are translated.
lang:<language>If you specify a language, all translation string lists in this language are translated. can be the language name in English ("German"), the language code ("deu") or the language ID ("07").
id:<id>Use this parameter to specify the string list to be updated based on the ID. If you are dealing with a source list and you do not specify a language, all associated translation string lists are translated.
Example

This command pre-translates the German translation string list for the source notepad.

pslcmd c:\projects\myProject.lpu /translate source:notepad lang:German

This command pre-translates all German translation string lists for this project.

pslcmd c:\projects\myProject.lpu /translate lang:German
/update
This command updates the source string lists and translation lists.
Syntax
/update [source:<title>] [sourcefile:<filepath>] [altsourcefile:<filepath>][nosource] [lang:<Language>] [notrans] [id:<ID>] [virtualFolder:<path>
Parameters
source:<Title>Use this parameter to specify a source list to be updated based on the title. If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated.
sourcefile:<filepath>Use this parameter to specify a source list to be updated based on the source file path. If you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated.
altsourcefile:<filepath>If just one source string list is updated (e.g. by indicating a source parameter), you can specify an alternative source file to be read instead of the file given in the project settings.
nosourceUse this parameter to prevent the update of source string lists.
lang:<languagename>If you indicate a language, only the translation lists for this language are updated. <languagename> can be the language name in English ("German"), the language code ("deu") or the language ID ("07").
notransUse this parameter to prevent the update of translation lists.
id:<id>Use this parameter to specify the string list to be updated based on the ID. If this is a source string list and you do not indicate a language and do not use the notrans parameter, all the corresponding translation lists are also updated.
ifrequiredIf this parameter is set, only the required text lists are updated. I.e. the text lists whose source files or respectively source lists have been modified since the last generation.
virtualFolderUse this parameter to specify the path to a virtual folder structure. It will also create a virtual folder if there is none.
Example

This command updates the source string list for Notepad and the corresponding German translation list.

pslcmd c:\projects\myProject.lpu /update source:notepad lang:German

This command updates all the source string lists

pslcmd c:\projects\myProject.lpu /update notrans

This command updates the source string list for Notepad using an alternative source file

pslcmd c:\projects\myProject.lpu /update source:notepad altsourcefile:"c:\examples\notepad.exe"
/writeoutput

This command writes a line of text to the output window Translation and, if specified, the output file (see /output)

Syntax
/writeoutput:<textline> 
/writeoutput:<textline>
Example

This command appends all the messages to c:\output.txt.

pslcmd c:\projects\myproject.lpu /writeoutput:"Start batch" /batch /writeoutput:"Batch ended" /output:c:\output.txt append