Ellié Computing Home Page
My Shopping Cart

Your shopping cart is empty

Display Cart

Call us at +1 586 62 ELLIE / +1 586 62 35543 Office Closed
sales@elliecomputing.com - Contact us


use all the options of Ellié Computing Merge from command line?

 

 

Ellié Computing Merge is so rich that it is not reasonable to give access to all the options through command line parameters (with - or -- notation).

Nonetheless Ellié Computing Merge lets you access all of its options through scripting and you can script the command line both before the document is loaded and after any save or export command happen.

There are two groups of scripts: pre loading scripts (--pdl-script group of options) and post writing scripts (--script group of options). Pre loading scripts are executed just after the command line constitute the documents parameters and before the documents gets loaded. Post writing scripts are run after the export or save command if any.

Sample

ecmerge file0 file1 file2 --sip --pdl-script-text="var params = initial_document.parameters.clone(); params.settings.set_xml(VFS.load_text('template.xml')); params.left.output = true; initial_document.parameters = params;"

This script shows an important point: you cannot modify Document.parameters sub-objects directly (why? because doing so would guide you into modifying members individually which would then result in execrable performances). This is the reason for the params variable.
Then it presents you with two technics:

  • First it uses SerializableObject.set_xml (implemented by OptionsSet), the params.settings.set_xml()  sets many options at a time, it is good choice if you have dozens of options to set, but it will also set all the options which may not be perfect for your usage.
  • Then it uses direct scripting with params.left.output = true; , you can use all the OptionsSet and Document.Parameters members, and make scripts as complex as needed to obtain the settings that you want.

Note that this sample uses --pdl-script-text, it could also use --pdl-script=script_filename.js which is particularly useful if the script is larger.

See also