Call us at +1 586 62 ELLIE Office Closed
sales@elliecomputing.com

Newsletter
Keep up to date with the new features added to ECMerge, the new products that we release and receive special offers! (approx. once a month):
HTML version
Text version
Beta Test - Free licence
WeblogRSS 2.0
Testimonials

NewsRSS 2.0
December 12th, 2008: We just released ECMerge 2.2 beta. This version introduces several new features, from which the Launcher, automatic session, shared options, file types and numerous improvements.

November 21st, 2008: We just parametered ECMerge for a new converter (ExifTool) which extracts metadata from a large number of files types (exe, images, audio, video...), find all the need info on the converters page.
               

Application object

 

 

Application global object.

Syntax

An Application global object is created for you and only this object can exist in the application. It is named Application and is globally accessible, you can also access its properties directly.

Parameters

none.

Property Of

global name space.

Implemented In

ECMerge 2.1

Description

 The Application object let you access global information about the running application.

Properties

Property Description
current_frame DocumentFrame object. Read-Only. Active frame in the graphical user interface, null if there is no active frame
executable_path String. Read-Only. Path to the running executable.
initial_document Document object. Read-Only / Available only during initial scripts (undefined else). This document is the document built from the command line arguments. 
script_url URL object. Read-Only / Available only during initial scripts (undefined else). This URL points to the currently run script.
ui_language Locale String. Read-Only. Language used for the User Interface as a locale code (such as: en_US, fr or de)
version String. Version number of ECMerge, as MAJOR.MINOR.BUILD (e.g. "2.1.65")

 

Methods

add_frame
alert
choose
confirm
execute_macro
exit
gc
log
prompt

Examples

see functions samples.

See Also 

 none.

Method add_frame

Syntax

function add_frame (document, focus)
returns a DocumentFrame

Parameters

document. Document object. Document to be viewed
focus. Boolean. True to give the focus immediately to this frame

Method Of

Application.

Implemented In

ECMerge 2.1

Description

Adds a frame to view a document.

Examples

Example 1.

Loads a document from an ECMT file then add a view for it:

var doc = Document.load ("/home/user/myecmt.ecmt");
add_frame (doc, true);

See Also 

 DocumentFrame object

Method alert

Syntax

 function alert (text)

Parameters

 text. String. Text to display

Method Of

Application

Implemented In

ECMerge 2.1

Description

Displays a text in a message box

Examples

Example 1.

Displays the famous "hello world!" message:

alert ("hello world!");

Method choose

Syntax

function choose (prompt, text1, text2, text3...)
function choose (prompt, texts_array)
returns chosen index or -1 if cancelled

Parameters

prompt. String. Prompt to display to the user.
text1, text2, text3... String. Text to display in order.
texts_array. Array of String. Each element is displayed from 0 to length-1 in order.

Method Of

Application

Implemented In

ECMerge 2.1

Description

Let the user choose from a list of text strings, with a prompt.

Examples

Example 1.

Prompt the user for a color then displays the index.

var chosen_color = choose ("Please choose a color:", "blue", "red");
if (chosen_color != -1)
    alert ("index " + chosen_color + "was chosen");

Example 2.

Prompt the user for a color from an Array then displays the chosen color.

var colors = ["blue", "red", "yellow", "white"];
var chosen_color = choose ("Please choose a color:", colors);
if (chosen_color != -1)
    alert ("color:" + colors[chosen_colors]);

Method confirm

Syntax

function confirm (prompt)
returns true if OK is pressed, false if cancel is pressed 

Parameters

prompt. String. Prompt displayed to the user

Method Of

Application.

Implemented In

ECMerge 2.1

Description

Displays a prompt to the user and makes him/her to press OK or cancel.

Examples

Example 1.

Ask if a file should be deleted.

var i_should = confirm ("Should I deleted this file?");

Method execute_macro

Syntax

 function execute_macro (macro_name)

Parameters

macro_name. String. Name of the macro to execute

Method Of

Application

Implemented In

ECMerge 2.1

Description

Executes a macro-command in the current application context. Macro commands are listed in the user interface in the Key Binding options panel.

Examples

Example 1.

Closes the current frame (potentially asking if the document should be saved or discarded)

execute_macro ("file_close");

Method exit

Syntax

function exit (exit_code)

Parameters

exit_code. Integer. Code to return as the application exit code. Usually 0 means success, any other value indicate an error.

Method Of

Application.

Implemented In

ECMerge 2.1

Description

Terminates the execution of the script, then the execution of the application.

Examples

Example 1.

Returns an exite code depending on a success variable.

var success = true;
exit (success ? 0 : 1);

Method gc

Syntax

 function gc( )

Parameters

none.

Method Of

global name space.

Implemented In

ECMerge 2.1

Description

Forces a garbage collection. Garbage collection is sometime necessary, in particular when resources are locked by objects which were already released, such as Document objects.

Method log

Syntax

function log (text)

Parameters

text. String. Text to be logged.

Method Of

global name space

Implemented In

ECMerge 2.1

Description

Logs a text to the log view or the standard message output in command line mode.

Examples

Example 1.

Logs a text.

log ("this was logged");

Method prompt

Syntax

function prompt (prompt)
returns a string

Parameters

prompt. String. Prompt for the text.

Method Of

Application

Implemented In

ECMerge 2.1

Description

Prompts for a text.

Examples

Example 1.

Logs the text that the user types.

log (prompt ("Please enter a text to log:"));

 

Select your language English Français
© Ellié Computing 2004-2009 - Legal information - Resources