Skip to content

Instantly share code, notes, and snippets.

@ErinFinnegan
ErinFinnegan / Callback_example.js
Last active March 7, 2018 16:02
Callback example
/* Initialize CSInterface */
var csInterface = new CSInterface();
/* Nested callbacks (callback hell) */
csInterface.evalScript("firstFunction()", function(firstResult) {
csInterface.evalScript(`secondFunction(${firstResult})`, function(
secondResult
) {
csInterface.evalScript(`thirdFunction(${secondResult})`, function(
thirdResult
@ErinFinnegan
ErinFinnegan / add10Layers.jsx
Created March 23, 2018 18:34
A function to add ten layers in Photoshop
function add10Layers(){
// First I set a variable to point at the currently open Photoshop document
var docRef = app.activeDocument
// Next I'll check to make sure the active document is the target
var i = docRef.artLayers.length;
// Then I'll run a for loop up to ten to add 10 layers:
for (i=0; i<10; i++) {
@ErinFinnegan
ErinFinnegan / LayerMakerIndex.html
Created March 23, 2018 18:44
LayerMaker Index file code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Layer Maker</title>
</head>
<body>
<div id="content">
<div>
<h2>Let's Make Layers</h2>
<?xml version='1.0' encoding='UTF-8'?>
<ExtensionManifest ExtensionBundleId="com.cep.watermark" ExtensionBundleVersion="1.0.0" Version="7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionList>
<Extension Id="com.cep.watermark.panel" Version="1.0.0" />
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<Host Name="PHSP" Version="18.0" />
<Host Name="PHXS" Version="18.0" />
<!-- <Host Name="PHSP" Version="[14.0,1000.0]" /> -->
box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 22px 70px 4px rgba(0,0,0,0.56), 0 0 0 1px rgba(0, 0, 0, 0.3);
{
"id": "YOUR_ID_HERE",
"name": "Name of Your Plugin",
"version": "0.0.1",
"description": "Description of your plugin.",
"icons": [
{ "width": 96, "height": 96, "path": "images/icon@2x.png" }
],
<?xml version='1.0' encoding='UTF-8'?>
<!-- 1) -->
<ExtensionManifest ExtensionBundleId="com.my.test" ExtensionBundleVersion="1.0.0" Version="7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtensionList>
<!-- 2) -->
<Extension Id="com.my.test.panel" Version="1.0.0" />
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<!-- 3) -->
@ErinFinnegan
ErinFinnegan / CDS2019_scehdule_updates.md
Last active June 3, 2019 19:26
Creative Developers Summit: Friday, June 14th, 2019 Updates
  • 7:30 – 9:00 am: Breakfast (provided)
  • 9:00 am: Welcome, from Ash Arnwine and Chuck Weger
  • 9:15 am – 12:00 pm: Adobe-led content, including:
    • State of the developer experience, Ash Arnwine, Erin Finnegan
    • New: UXP in 2019, Kerri Shotts
    • New: CEP, ExtendScript, and ESTK in 2019, Prerna Vij
    • Updates and Roadmaps:
      • New: Photoshop & UXP, Barkin Aygun
      • Illustrator, Dirk Schulze, Senior Computer Scientist, and Varun Sharma, Product Manager
  • InDesign, Amish Kumar Bedi, Computer Scientist, InDesign Engineering
@ErinFinnegan
ErinFinnegan / vscodehint.json
Last active June 6, 2019 19:20
Want the VSCode ExtendScript Debugger to just run the active file? Use this configuration and in VSCode Debug Menu -> Start Without Debugging OR (^F5)
{
"type": "extendscript-debug",
"request": "launch",
"name": "Current File",
"program": "${file}"
}
@ErinFinnegan
ErinFinnegan / CreateTranslationNoteThumbnail.js
Last active July 8, 2019 20:16
InDesign Scripts for Manga Editors
var myDocument = app.documents.item(0);
// Set up Translation Note Box Object Style
try {
myBoxStyle = myDocument.objectStyles.item("Translation Note Box"); // If the style does not exist, trying to get its name will generate an error.
myName = myBoxStyle.name;
} catch (myError) { // The style did not exist, so create it.
myBoxStyle = myDocument.objectStyles.add( {name:"Translation Note Box"});
}