|
Application object
Application global object. SyntaxAn 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. Parametersnone. Property Ofglobal name space. Implemented InECMerge 2.1 DescriptionThe Application object let you access global information about the running application. Properties
Methodsadd_frame Examplessee functions samples. See Also
Method add_frameSyntaxfunction add_frame (document, focus) Parametersdocument. Document
object. Document to be viewed Method OfApplication. Implemented InECMerge 2.1 DescriptionAdds a frame to view a document. ExamplesExample 1.Loads a document from an ECMT file then add a view for it: var doc = Document.load
("/home/user/myecmt.ecmt"); See Also
Method alertSyntaxfunction alert (text) Parameterstext. String. Text to display Method OfApplication Implemented InECMerge 2.1 DescriptionDisplays a text in a message box ExamplesExample 1.Displays the famous "hello world!" message: alert ("hello world!"); Methods choose / prompt_with_choicesSyntaxfunction choose (prompt, text1, text2, text3...) function prompt_with_choices (prompt, text1, text2,
text3...) Parametersprompt. String. Prompt to display to the user. Method OfApplication Implemented InECMerge 2.1 DescriptionLet the user choose from a list of text strings, with a prompt. ExamplesExample 1.Prompt the user for a color then displays the index. var chosen_color = choose ("Please choose a color:",
"blue", "red"); Example 2.Prompt the user for a color from an Array then displays the chosen color. var colors = ["blue", "red", "yellow", "white"]; Example 3.Prompt the user for a color from an Array then displays the chosen color, letting the user type in another color. var colors = ["blue", "red", "yellow", "white"]; Method clone_options_setSyntaxfunction clone_options_set ( name ) Parametersname. String. Name of the OptionsSet to retrieve Method OfApplication. Implemented InECMerge 2.1 DescriptionReturns a clone of the named OptionsSet. ExamplesExample 1.Applies an OptionsSet to an existing document: See Also
Method clone_shared_optionsSyntaxfunction clone_share_options ( ) Parametersnone. Method OfApplication. Implemented InECMerge 2.2 DescriptionReturns a clone of the shared options of the application, that is, file types and converters (respectively "file_types" and "filters" sections). See Also
Method confirmSyntaxfunction confirm (prompt) Parametersprompt. String. Prompt displayed to the user Method OfApplication. Implemented InECMerge 2.1 DescriptionDisplays a prompt to the user and makes him/her to press OK or cancel. ExamplesExample 1.Ask if a file should be deleted. var i_should = confirm ("Should I deleted this file?"); Method execute_macroSyntaxfunction execute_macro (macro_name) Parametersmacro_name. String. Name of the macro to execute Method OfApplication Implemented InECMerge 2.1 DescriptionExecutes a macro-command in the current application context. Macro commands are listed in the user interface in the Key Binding options panel. ExamplesExample 1.Closes the current frame (potentially asking if the document should be saved or discarded) execute_macro ("file_close"); Method exitSyntaxfunction exit (exit_code) Parametersexit_code. Integer. Code to return as the application exit code. Usually 0 means success, any other value indicate an error. Method OfApplication. Implemented InECMerge 2.1 DescriptionTerminates the execution of the script, then the execution of the application. ExamplesExample 1.Returns an exite code depending on a success variable. var success = true; Method gcSyntaxfunction gc( ) Parametersnone. Method Ofglobal name space. Implemented InECMerge 2.1 DescriptionForces 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 get_options_sets_namesSyntaxfunction get_options_sets_names ( ) Parametersnone Method OfApplication. Implemented InECMerge 2.2 DescriptionReturns the list of options sets names. See Also
Method logSyntaxfunction log (text) Parameterstext. String. Text to be logged. Method Ofglobal name space Implemented InECMerge 2.1 DescriptionLogs a text to the log view or the standard message output in command line mode. ExamplesExample 1.Logs a text. log ("this was logged"); Method popup_menuSyntaxfunction popup_menu (menu) Parametersmenu. A menu items Array. Menu to be displayed Method OfApplication. Implemented InECMerge 2.2 DescriptionDisplays a contextual menu where the mouse cursor is currently placed. The menu is made of menu items defined as below. Description of menu items
ExamplesExample 1.This sample displays a menu with two dummy items: See Also
Method promptSyntaxfunction prompt (prompt) Parametersprompt. String. Prompt for the text. Method OfApplication Implemented InECMerge 2.1 DescriptionPrompts for a text. ExamplesExample 1.Logs the text that the user types. log (prompt ("Please enter a text to log:"));
Method set_shared_optionsSyntaxfunction set_share_options ( sdo ) Parameterssdo. OptionsSet object limited to shared options. Shared options to set Method OfApplication. Implemented InECMerge 2.2 DescriptionSets the shared options of the Application, those options are immediately propagated to all the master copies of the options sets (those actually sharing file types and converters). In addition, if the master copy of the options set of current view actually evolved, the view gets the changes as if validated by the options set box. See Also
|
|||||||||||||||||||||||||||||||||||