Dans cet article
Banana.Script represents the interface to the script file and can be accessed through Banana.script. It is used to get the parameter values defined in the script. For example if you want to print out in a report the publishing date of the script.
Properties
Methods
getParamValue(paramName)
Return the value defined in the script file of the parameter paramName. Return an empty string or the internal default value if the parameter is not defined. Return the first found value, if the parameter is defined multiple times.
Banana.script.getParamValue('pubdate'); // returns for example '2016-05-11'
getParamValues(paramName)
Return all the values defined in the script file of the param paramName . Return an empty array if the parameter paramName is not defined.
// Script.js example:
// ...
// @authors = Pinco
// @authors = Pallino
// ...
Banana.script.getParamValues('authors'); // returns ['Pinco', 'Pallino']
getParamLocaleValue(paramName)
Return the localized value defined in the script file of the param paramName. Return an empty string the parameter is not defined.
// Script.js example:
// ...
// @description = English desciption
// @description.it = Descrizione italiana
// @description.de = German Beschreibung
...
Banana.script.getParamLocaleValue('description'); // returns 'Descrizione italiana' for a system running with the locale 'italian'.
getPath()
Return the path where the extension is located on the computer.
Banana.script.getPath(); // returns for example '/Users/banana.ch/.../ch.banana.application.invoice.default.sbaa'