This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style> | |
| .container { | |
| margin: 8px; | |
| display: flex; | |
| flex-direction: row; | |
| justify-content: flex-start; | |
| } | |
| span { | |
| color: darkgoldenrod; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HelloWorld extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <span> 'Hello World!'</span> | |
| <style> | |
| span { | |
| font-style: italic; | |
| color: darkblue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "featureFlags": { | |
| "enableSWCSupport": true | |
| }, | |
| "host": [ | |
| { | |
| "app": "PS", | |
| "minVersion": "24.4" | |
| } | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <canvas id="canvas" height="250" width="250"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function drawShape() { | |
| const canvas = document.getElementById("canvas"); | |
| // get the canvas context | |
| let context = canvas.getContext("2d"); | |
| //draw triangle | |
| context.lineWidth = 2.0; | |
| context.beginPath(); | |
| context.moveTo(20, 20); | |
| context.lineTo(100, 20); | |
| context.lineTo(100, 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <img id="image"></img> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function createBlueBox() { | |
| const width = 8; | |
| const height = 8; | |
| let buffer = new ArrayBuffer(width * height * 4); | |
| let colorArrayView = new Uint8Array(buffer); | |
| // Define pixels. Fill it with blue. | |
| for (let i = 0; i < colorArrayView.length / 4; i++) { | |
| colorArrayView[i * 4] = 0x00; // R | |
| colorArrayView[i * 4 + 1] = 0x0; // G |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in InDesign v18.0 | |
| let doc = app.documents.add(); | |
| // InDesign v18.4 onwards | |
| let idDom = require("indesign"); | |
| let doc = idDom.app.documents.add(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let idDom = require("indesign_18.0"); // selects v18.0 version | |
| let doc = idDom.app.documents.add(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const addon = await require("sample.uxpaddon"); | |
| const result = addon.getGreeting(); | |
| console.log(`The plugins says: ${result}`); |
NewerOlder