![]() |
Appelez nous au +1 586 62 ELLIE
|
|
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!");
Method chooseSyntaxfunction choose (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"];
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 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 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:"));
|
||||||||||||||||||||||||
|
Sélectionnez la langue English Français | |||||||||||||||||||||||||