Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
templator [2022/06/06 04:21] – [Javascript] o2wikitemplator [2022/06/06 04:29] – [Javascript] o2wiki
Line 108: Line 108:
 ==== Javascript ==== ==== Javascript ====
  
-You can run Extendscript or Javascript to modify the document and return additional text changes to Templator. Your code will wrapped in a function so ensure that you include a return statement with the required data structure. +You can run Extendscript or Javascript to modify the document and return additional text changes to Templator. Your code will be wrapped in a function so ensure that you include a return statement with the required data structure.
- +
-  *  **ExtendScript in Illustrator** +
-    * Runs the code in Extendscript in Illustrator allowing you to modify and get information from the document.  +
-    * Note that ExtendScript and not modern ES6 Javascript and does not support the latest features of Javascript. see[[ https://ai-scripting.docsforadobe.dev/|Adobe scripting reference for details]].\\ +
-  * ** Javascript in CEP/NodeJS ** +
-    * Runs the code in the CEP Panel of PowerScripts, this is modern Javascript running on NodeJS, see https://github.com/Adobe-CEP/CEP-Resources.  +
-    * Note that the following libraries are already loaded CSInterface, JQuery, Lodash, Moment.js, Numeral-js.  +
-    * You can run ExtendScript code using CSInterface.evalScript. +
-    * To asynchronously get data, return a Function, This function will be called with the first argument data and the second a callback +
-  * **Warning: Make sure your code is self-contained and does not pollute the global scope**+
  
 Your code must return the standard object indicating success and any error messages/text changes, see the next section. Your code must return the standard object indicating success and any error messages/text changes, see the next section.
 +
 +**Warning: Make sure your code is self-contained and does not pollute the global scope**
 +
 +==ExtendScript in Illustrator==
 +  * Runs the code in Extendscript in Illustrator allowing you to modify and get information from the document. 
 +  * Note that ExtendScript and not modern ES6 Javascript and does not support the latest features of Javascript. see[[ https://ai-scripting.docsforadobe.dev/|Adobe scripting reference for details]].\\
  
 == Extendscript Example == == Extendscript Example ==
Line 142: Line 138:
 }; };
 </sxh> </sxh>
 +
 +== Javascript in CEP/NodeJS ==
 +  * Runs the code in the CEP Panel of PowerScripts, this is modern Javascript running on NodeJS, see https://github.com/Adobe-CEP/CEP-Resources.    
 +  * Note that the following libraries are already loaded CSInterface, JQuery, Lodash, Moment.js, Numeral-js. 
 +  * You can run ExtendScript code using CSInterface.evalScript.
 +  * To asynchronously get data, return a Function, This function will be called with the first argument data and the second a callback
  
 == Javascript/Node Async Example == == Javascript/Node Async Example ==