@ajsmonty/adobe-mcp 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/SECURITY.md +24 -0
- package/adapters/ae.mjs +201 -0
- package/adapters/ai.mjs +153 -0
- package/adapters/ch.mjs +125 -0
- package/adapters/ppro.mjs +239 -0
- package/adapters/ps.mjs +168 -0
- package/cep/mcp-bridge/CSXS/manifest.xml +44 -0
- package/cep/mcp-bridge/index.html +18 -0
- package/cep/mcp-bridge/main.js +49 -0
- package/core/bridge.mjs +222 -0
- package/core/harness.jsx +67 -0
- package/knowledge/knowledge.mjs +198 -0
- package/knowledge/lessons.jsonl +28 -0
- package/package.json +48 -0
- package/scripts/ae/Kinetic_Cascade_Text.jsx +42 -0
- package/scripts/ae/Wind_Loop_Turbulent.jsx +30 -0
- package/scripts/ppro/Auto_Vertical_Reframe.jsx +10 -0
- package/scripts/ps/Blueprint_Line_Extract.jsx +12 -0
- package/server.mjs +51 -0
- package/workflow/workflow.mjs +180 -0
package/core/bridge.mjs
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// adobe-mcp core bridge: routes ExtendScript to each app.
|
|
2
|
+
// AE/PS/AI: osascript (AppleScript DoScript / do javascript).
|
|
3
|
+
// Premiere: command-file handoff to the mcp-bridge CEP panel.
|
|
4
|
+
import { execFile } from "node:child_process";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { logError, matchError, hintBlock } from "../knowledge/knowledge.mjs";
|
|
10
|
+
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const HARNESS = fs.readFileSync(path.join(__dirname, "harness.jsx"), "utf8");
|
|
13
|
+
|
|
14
|
+
export const WORKSPACE =
|
|
15
|
+
process.env.ADOBE_MCP_WORKSPACE || path.join(os.homedir(), "AdobeMCP");
|
|
16
|
+
export const PPRO_BRIDGE_DIR = path.join(WORKSPACE, "ppro-bridge");
|
|
17
|
+
fs.mkdirSync(WORKSPACE, { recursive: true });
|
|
18
|
+
fs.mkdirSync(PPRO_BRIDGE_DIR, { recursive: true });
|
|
19
|
+
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// App registry
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
function findApp(dirPattern, fallback, envVar) {
|
|
25
|
+
if (process.env[envVar]) return process.env[envVar];
|
|
26
|
+
try {
|
|
27
|
+
const dirs = fs
|
|
28
|
+
.readdirSync("/Applications")
|
|
29
|
+
.filter((e) => dirPattern.test(e))
|
|
30
|
+
.sort();
|
|
31
|
+
if (dirs.length) {
|
|
32
|
+
const dir = dirs[dirs.length - 1];
|
|
33
|
+
if (dir.endsWith(".app")) return dir.replace(/\.app$/, "");
|
|
34
|
+
const inner = fs
|
|
35
|
+
.readdirSync(path.join("/Applications", dir))
|
|
36
|
+
.find((f) => f.endsWith(".app"));
|
|
37
|
+
if (inner) return inner.replace(/\.app$/, "");
|
|
38
|
+
return dir;
|
|
39
|
+
}
|
|
40
|
+
} catch {
|
|
41
|
+
/* fall through */
|
|
42
|
+
}
|
|
43
|
+
return fallback;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const APPS = {
|
|
47
|
+
ae: {
|
|
48
|
+
label: "After Effects",
|
|
49
|
+
bridge: "osascript",
|
|
50
|
+
appName: () => findApp(/^Adobe After Effects/i, "Adobe After Effects", "AE_APP_NAME"),
|
|
51
|
+
osa: (app, jsxPath) =>
|
|
52
|
+
`tell application "${app}" to DoScript "$.evalFile('${jsxPath}')"`,
|
|
53
|
+
undoGroup: true,
|
|
54
|
+
writePrefHint:
|
|
55
|
+
' Enable AE Preferences → Scripting & Expressions → "Allow Scripts to Write Files and Access Network".',
|
|
56
|
+
},
|
|
57
|
+
ps: {
|
|
58
|
+
label: "Photoshop",
|
|
59
|
+
bridge: "osascript",
|
|
60
|
+
appName: () => findApp(/^Adobe Photoshop/i, "Adobe Photoshop 2026", "PS_APP_NAME"),
|
|
61
|
+
osa: (app, jsxPath) =>
|
|
62
|
+
`tell application "${app}" to do javascript "$.evalFile(new File('${jsxPath}'))"`,
|
|
63
|
+
undoGroup: false,
|
|
64
|
+
writePrefHint: "",
|
|
65
|
+
},
|
|
66
|
+
ai: {
|
|
67
|
+
label: "Illustrator",
|
|
68
|
+
bridge: "osascript",
|
|
69
|
+
appName: () => findApp(/^Adobe Illustrator/i, "Adobe Illustrator", "AI_APP_NAME"),
|
|
70
|
+
osa: (app, jsxPath) =>
|
|
71
|
+
`tell application "${app}" to do javascript "$.evalFile(new File('${jsxPath}'))"`,
|
|
72
|
+
undoGroup: false,
|
|
73
|
+
writePrefHint: "",
|
|
74
|
+
},
|
|
75
|
+
ppro: {
|
|
76
|
+
label: "Premiere Pro",
|
|
77
|
+
bridge: "panel",
|
|
78
|
+
appName: () => findApp(/^Adobe Premiere Pro/i, "Adobe Premiere Pro 2026", "PPRO_APP_NAME"),
|
|
79
|
+
undoGroup: false,
|
|
80
|
+
writePrefHint: "",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// Execution
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
function osascript(script, timeoutMs) {
|
|
89
|
+
return new Promise((resolve, reject) => {
|
|
90
|
+
execFile(
|
|
91
|
+
"osascript",
|
|
92
|
+
["-e", script],
|
|
93
|
+
{ timeout: timeoutMs, killSignal: "SIGKILL" },
|
|
94
|
+
(err, stdout, stderr) => {
|
|
95
|
+
if (err) {
|
|
96
|
+
err.stderr = stderr;
|
|
97
|
+
reject(err);
|
|
98
|
+
} else resolve(stdout);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
105
|
+
|
|
106
|
+
function writeHarnessed(appKey, userCode, resultPath, scriptPath) {
|
|
107
|
+
const app = APPS[appKey];
|
|
108
|
+
const undoOpen = app.undoGroup ? "app.beginUndoGroup('adobe-mcp');" : "";
|
|
109
|
+
const undoClose = app.undoGroup ? "app.endUndoGroup();" : "";
|
|
110
|
+
const wrapped = HARNESS.replace(/__RESULT_PATH__/g, () => JSON.stringify(resultPath))
|
|
111
|
+
.replace(/__USER_CODE__/g, () => userCode)
|
|
112
|
+
.replace(/__UNDO_OPEN__/g, () => undoOpen)
|
|
113
|
+
.replace(/__UNDO_CLOSE__/g, () => undoClose);
|
|
114
|
+
fs.writeFileSync(scriptPath, wrapped, "utf8");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function awaitResultFile(resultPath, timeoutMs, failMsg) {
|
|
118
|
+
const deadline = Date.now() + timeoutMs;
|
|
119
|
+
let raw = null;
|
|
120
|
+
while (Date.now() < deadline) {
|
|
121
|
+
if (fs.existsSync(resultPath)) {
|
|
122
|
+
raw = fs.readFileSync(resultPath, "utf8");
|
|
123
|
+
if (raw.length) break;
|
|
124
|
+
}
|
|
125
|
+
await sleep(120);
|
|
126
|
+
}
|
|
127
|
+
if (raw === null) throw new Error(failMsg);
|
|
128
|
+
fs.rmSync(resultPath, { force: true });
|
|
129
|
+
let parsed;
|
|
130
|
+
try {
|
|
131
|
+
parsed = JSON.parse(raw);
|
|
132
|
+
} catch {
|
|
133
|
+
throw new Error(`Could not parse result: ${raw.slice(0, 2000)}`);
|
|
134
|
+
}
|
|
135
|
+
if (!parsed.ok) throw new Error(`ExtendScript error (line ${parsed.line}): ${parsed.error}`);
|
|
136
|
+
return parsed.result;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function pproPanelAlive() {
|
|
140
|
+
const hb = path.join(PPRO_BRIDGE_DIR, "heartbeat");
|
|
141
|
+
try {
|
|
142
|
+
return Date.now() - Number(fs.readFileSync(hb, "utf8")) < 5000;
|
|
143
|
+
} catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Run ExtendScript inside the given app. Returns the JSON-decoded result.
|
|
150
|
+
* On failure: logs the error to the workspace error log and appends any
|
|
151
|
+
* matching knowledge-base lessons to the error message (the learning loop).
|
|
152
|
+
*/
|
|
153
|
+
export async function runJSX(appKey, userCode, timeoutMs = 120000) {
|
|
154
|
+
try {
|
|
155
|
+
return await runJSXInner(appKey, userCode, timeoutMs);
|
|
156
|
+
} catch (e) {
|
|
157
|
+
logError(appKey, userCode, e.message || e);
|
|
158
|
+
const hints = matchError(appKey, e.message || String(e));
|
|
159
|
+
if (hints.length) e.message = `${e.message}${hintBlock(hints)}`;
|
|
160
|
+
throw e;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async function runJSXInner(appKey, userCode, timeoutMs = 120000) {
|
|
165
|
+
const app = APPS[appKey];
|
|
166
|
+
if (!app) throw new Error(`Unknown app "${appKey}". Use: ${Object.keys(APPS).join(", ")}`);
|
|
167
|
+
const stamp = `${Date.now()}_${Math.floor(Math.random() * 1e6)}`;
|
|
168
|
+
const resultPath = path.join(os.tmpdir(), `adobe_mcp_result_${appKey}_${stamp}.json`);
|
|
169
|
+
const scriptPath = path.join(os.tmpdir(), `adobe_mcp_script_${appKey}_${stamp}.jsx`);
|
|
170
|
+
writeHarnessed(appKey, userCode, resultPath, scriptPath);
|
|
171
|
+
|
|
172
|
+
if (app.bridge === "osascript") {
|
|
173
|
+
const appName = app.appName();
|
|
174
|
+
try {
|
|
175
|
+
await osascript(app.osa(appName, scriptPath), timeoutMs);
|
|
176
|
+
} catch (err) {
|
|
177
|
+
fs.rmSync(resultPath, { force: true });
|
|
178
|
+
const msg = String(err.stderr || err.message || err);
|
|
179
|
+
let hint = "";
|
|
180
|
+
if (err.killed || /timed?.?out/i.test(msg)) {
|
|
181
|
+
hint = ` Timed out after ${timeoutMs / 1000}s — ${app.label} may be showing a modal dialog, or raise timeout_seconds. Script kept: ${scriptPath}`;
|
|
182
|
+
} else if (/-600|isn.t running|can.t be found|-1728|-10810/i.test(msg)) {
|
|
183
|
+
hint = ` Is ${app.label} open? (Looked for app "${appName}"; override with env var.)`;
|
|
184
|
+
} else if (/-1743|not authori[sz]ed/i.test(msg)) {
|
|
185
|
+
hint = ` macOS blocked Automation permission for ${app.label} — approve in System Settings → Privacy & Security → Automation.`;
|
|
186
|
+
}
|
|
187
|
+
throw new Error(`osascript failed: ${msg.trim()}.${hint}`);
|
|
188
|
+
}
|
|
189
|
+
const result = await awaitResultFile(
|
|
190
|
+
resultPath,
|
|
191
|
+
15000,
|
|
192
|
+
`${app.label} ran the script but no result file appeared.${app.writePrefHint} Script kept: ${scriptPath}`
|
|
193
|
+
);
|
|
194
|
+
fs.rmSync(scriptPath, { force: true });
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// panel bridge (Premiere)
|
|
199
|
+
if (!pproPanelAlive()) {
|
|
200
|
+
throw new Error(
|
|
201
|
+
"Premiere mcp-bridge panel is not running. In Premiere: Window → Extensions → MCP Bridge " +
|
|
202
|
+
"(requires the panel installed under ~/Library/Application Support/Adobe/CEP/extensions and " +
|
|
203
|
+
"PlayerDebugMode=1 for com.adobe.CSXS.11)."
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
const cmdPath = path.join(PPRO_BRIDGE_DIR, `cmd_${stamp}.json`);
|
|
207
|
+
fs.writeFileSync(cmdPath, JSON.stringify({ jsx: scriptPath }), "utf8");
|
|
208
|
+
const result = await awaitResultFile(
|
|
209
|
+
resultPath,
|
|
210
|
+
timeoutMs,
|
|
211
|
+
`Premiere panel accepted the command but no result appeared. A modal dialog may be open, or the JSX failed to parse. Script kept: ${scriptPath}`
|
|
212
|
+
);
|
|
213
|
+
fs.rmSync(scriptPath, { force: true });
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Small helper shared by preview tools: downscale a PNG with sips.
|
|
218
|
+
export async function downscalePng(pngPath, maxWidth) {
|
|
219
|
+
await new Promise((resolve) =>
|
|
220
|
+
execFile("sips", ["-Z", String(maxWidth), pngPath], () => resolve())
|
|
221
|
+
);
|
|
222
|
+
}
|
package/core/harness.jsx
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// ae-mcp ExtendScript harness.
|
|
2
|
+
// Wraps user code in a try/catch + undo group, serializes the return value
|
|
3
|
+
// to JSON (ExtendScript is ES3 — no native JSON), writes it to __RESULT_PATH__.
|
|
4
|
+
(function () {
|
|
5
|
+
function __q(s) {
|
|
6
|
+
s = String(s);
|
|
7
|
+
var out = '"';
|
|
8
|
+
for (var i = 0; i < s.length; i++) {
|
|
9
|
+
var c = s.charAt(i);
|
|
10
|
+
if (c === '"') out += '\\"';
|
|
11
|
+
else if (c === '\\') out += '\\\\';
|
|
12
|
+
else if (c === '\n') out += '\\n';
|
|
13
|
+
else if (c === '\r') out += '\\r';
|
|
14
|
+
else if (c === '\t') out += '\\t';
|
|
15
|
+
else if (s.charCodeAt(i) < 32) out += ' ';
|
|
16
|
+
else out += c;
|
|
17
|
+
}
|
|
18
|
+
return out + '"';
|
|
19
|
+
}
|
|
20
|
+
function __json(v, d) {
|
|
21
|
+
d = d || 0;
|
|
22
|
+
if (d > 8) return '"[max depth reached]"';
|
|
23
|
+
if (v === null || v === undefined) return 'null';
|
|
24
|
+
var t = typeof v;
|
|
25
|
+
if (t === 'number') return (v === v && v !== Infinity && v !== -Infinity) ? String(v) : 'null';
|
|
26
|
+
if (t === 'boolean') return String(v);
|
|
27
|
+
if (t === 'string') return __q(v);
|
|
28
|
+
if (t === 'function') return '"[function]"';
|
|
29
|
+
if (v instanceof Array) {
|
|
30
|
+
var a = [];
|
|
31
|
+
for (var i = 0; i < v.length; i++) a.push(__json(v[i], d + 1));
|
|
32
|
+
return '[' + a.join(',') + ']';
|
|
33
|
+
}
|
|
34
|
+
if (t === 'object') {
|
|
35
|
+
var p = [];
|
|
36
|
+
for (var k in v) {
|
|
37
|
+
try {
|
|
38
|
+
p.push(__q(k) + ':' + __json(v[k], d + 1));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
p.push(__q(k) + ':"[unserializable]"');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return '{' + p.join(',') + '}';
|
|
44
|
+
}
|
|
45
|
+
return __q(String(v));
|
|
46
|
+
}
|
|
47
|
+
var __payload;
|
|
48
|
+
try {
|
|
49
|
+
__UNDO_OPEN__
|
|
50
|
+
var __result;
|
|
51
|
+
try {
|
|
52
|
+
__result = (function () {
|
|
53
|
+
__USER_CODE__
|
|
54
|
+
})();
|
|
55
|
+
} finally {
|
|
56
|
+
__UNDO_CLOSE__
|
|
57
|
+
}
|
|
58
|
+
__payload = '{"ok":true,"result":' + __json(__result) + '}';
|
|
59
|
+
} catch (__e) {
|
|
60
|
+
__payload = '{"ok":false,"error":' + __q(__e.toString()) + ',"line":' + (Number(__e.line) || 0) + '}';
|
|
61
|
+
}
|
|
62
|
+
var __f = new File(__RESULT_PATH__);
|
|
63
|
+
__f.encoding = 'UTF-8';
|
|
64
|
+
__f.open('w');
|
|
65
|
+
__f.write(__payload);
|
|
66
|
+
__f.close();
|
|
67
|
+
})();
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// adobe-mcp knowledge system.
|
|
2
|
+
//
|
|
3
|
+
// Two-tier lesson store:
|
|
4
|
+
// knowledge/lessons.jsonl — curated lessons shipped with the repo (seeded from real sessions)
|
|
5
|
+
// $WORKSPACE/learned.jsonl — lessons added at runtime via knowledge_add (survives repo updates)
|
|
6
|
+
//
|
|
7
|
+
// Learning loop:
|
|
8
|
+
// 1. Every ExtendScript failure is logged to $WORKSPACE/error-log.jsonl (raw material for new lessons).
|
|
9
|
+
// 2. The bridge matches error text against each lesson's `match` keywords and appends the winning
|
|
10
|
+
// lessons to the error message the client sees — so a gotcha discovered once is surfaced
|
|
11
|
+
// automatically the next time anyone trips it.
|
|
12
|
+
// 3. Agents can consult the store up front (knowledge_search) and contribute (knowledge_add).
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import fs from "node:fs";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
|
|
19
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const WORKSPACE =
|
|
21
|
+
process.env.ADOBE_MCP_WORKSPACE || path.join(os.homedir(), "AdobeMCP");
|
|
22
|
+
const SEED_PATH = path.join(__dirname, "lessons.jsonl");
|
|
23
|
+
const LEARNED_PATH = path.join(WORKSPACE, "learned.jsonl");
|
|
24
|
+
const ERROR_LOG = path.join(WORKSPACE, "error-log.jsonl");
|
|
25
|
+
|
|
26
|
+
function readJsonl(p) {
|
|
27
|
+
try {
|
|
28
|
+
return fs
|
|
29
|
+
.readFileSync(p, "utf8")
|
|
30
|
+
.split("\n")
|
|
31
|
+
.filter((l) => l.trim())
|
|
32
|
+
.map((l) => {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(l);
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
.filter(Boolean);
|
|
40
|
+
} catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function loadLessons() {
|
|
46
|
+
return [...readJsonl(SEED_PATH), ...readJsonl(LEARNED_PATH)];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Lessons whose `match` keywords appear in the error text (best two). */
|
|
50
|
+
export function matchError(appKey, errText) {
|
|
51
|
+
const hay = String(errText).toLowerCase();
|
|
52
|
+
const scored = [];
|
|
53
|
+
for (const l of loadLessons()) {
|
|
54
|
+
if (l.app && l.app !== "any" && l.app !== appKey) continue;
|
|
55
|
+
if (!Array.isArray(l.match) || !l.match.length) continue;
|
|
56
|
+
const hits = l.match.filter((kw) => hay.includes(kw.toLowerCase())).length;
|
|
57
|
+
if (hits) scored.push([hits, l]);
|
|
58
|
+
}
|
|
59
|
+
scored.sort((a, b) => b[0] - a[0]);
|
|
60
|
+
return scored.slice(0, 2).map(([, l]) => l);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Keyword search over title + lesson text. */
|
|
64
|
+
export function searchLessons(query, appKey) {
|
|
65
|
+
const terms = String(query || "")
|
|
66
|
+
.toLowerCase()
|
|
67
|
+
.split(/\s+/)
|
|
68
|
+
.filter(Boolean);
|
|
69
|
+
const scored = [];
|
|
70
|
+
for (const l of loadLessons()) {
|
|
71
|
+
if (appKey && l.app !== appKey && l.app !== "any") continue;
|
|
72
|
+
const hay = `${l.title} ${l.lesson} ${(l.match || []).join(" ")}`.toLowerCase();
|
|
73
|
+
const hits = terms.filter((t) => hay.includes(t)).length;
|
|
74
|
+
if (!terms.length || hits) scored.push([hits, l]);
|
|
75
|
+
}
|
|
76
|
+
scored.sort((a, b) => b[0] - a[0]);
|
|
77
|
+
return scored.map(([, l]) => l);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function addLesson({ app, title, lesson, match = [], example }) {
|
|
81
|
+
fs.mkdirSync(WORKSPACE, { recursive: true });
|
|
82
|
+
const entry = {
|
|
83
|
+
id: `learned-${Date.now().toString(36)}`,
|
|
84
|
+
app: app || "any",
|
|
85
|
+
title,
|
|
86
|
+
lesson,
|
|
87
|
+
match,
|
|
88
|
+
...(example ? { example } : {}),
|
|
89
|
+
added: new Date().toISOString(),
|
|
90
|
+
source: "runtime",
|
|
91
|
+
};
|
|
92
|
+
fs.appendFileSync(LEARNED_PATH, JSON.stringify(entry) + "\n", "utf8");
|
|
93
|
+
return entry;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Called by the bridge on every failed script run. */
|
|
97
|
+
export function logError(appKey, code, errMsg) {
|
|
98
|
+
try {
|
|
99
|
+
fs.mkdirSync(WORKSPACE, { recursive: true });
|
|
100
|
+
fs.appendFileSync(
|
|
101
|
+
ERROR_LOG,
|
|
102
|
+
JSON.stringify({
|
|
103
|
+
at: new Date().toISOString(),
|
|
104
|
+
app: appKey,
|
|
105
|
+
error: String(errMsg).slice(0, 600),
|
|
106
|
+
code: String(code).slice(0, 1200),
|
|
107
|
+
}) + "\n",
|
|
108
|
+
"utf8"
|
|
109
|
+
);
|
|
110
|
+
} catch {
|
|
111
|
+
/* never let logging break the actual error path */
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Format lessons as a hint block appended to error messages. */
|
|
116
|
+
export function hintBlock(lessons) {
|
|
117
|
+
if (!lessons.length) return "";
|
|
118
|
+
return (
|
|
119
|
+
"\n\nKNOWN GOTCHA" +
|
|
120
|
+
(lessons.length > 1 ? "S" : "") +
|
|
121
|
+
" (from adobe-mcp knowledge base):\n" +
|
|
122
|
+
lessons.map((l) => `- ${l.title}: ${l.lesson}`).join("\n")
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Startup digest for the MCP server `instructions` field. */
|
|
127
|
+
export function instructionsDigest() {
|
|
128
|
+
const n = loadLessons().length;
|
|
129
|
+
return [
|
|
130
|
+
"adobe-mcp drives AE, Photoshop, Illustrator, Premiere and CH puppet authoring via ExtendScript.",
|
|
131
|
+
"",
|
|
132
|
+
"WORKING RULES (learned from real sessions):",
|
|
133
|
+
"1. TARGET DOCUMENTS EXPLICITLY. PS/AI active document can silently change between calls — start every PS/AI script with app.activeDocument = app.documents.getByName(...). Exports always act on the ACTIVE document.",
|
|
134
|
+
"2. VERIFY VISUALLY AT EVERY STAGE. Use ae_save_frame / ps_save_preview / ai_save_preview after each meaningful change, and verify final renders by extracting frames from the output file. For seamless loops, diff first vs last frame.",
|
|
135
|
+
"3. A RENDER TIMEOUT IS NOT A FAILED RENDER. If ae_render_comp/exports time out, check the output file (stable size, right duration) before re-running.",
|
|
136
|
+
"4. ES3 ONLY inside the apps: no JSON, let/const, arrows, Array.map. Collections are 1-indexed in AE.",
|
|
137
|
+
`5. CONSULT THE KNOWLEDGE BASE: ${n} lessons loaded. knowledge_search before attempting something unusual; failed scripts auto-surface matching lessons. When you solve a NEW gotcha (an error whose fix wasn't suggested), record it with knowledge_add so the server learns.`,
|
|
138
|
+
].join("\n");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function register(server, { text, errText }) {
|
|
142
|
+
server.registerTool(
|
|
143
|
+
"knowledge_search",
|
|
144
|
+
{
|
|
145
|
+
title: "Search the adobe-mcp knowledge base",
|
|
146
|
+
description:
|
|
147
|
+
"Search accumulated scripting lessons/gotchas for the Adobe apps (seeded + learned at runtime). " +
|
|
148
|
+
"Query by keywords, optionally filtered by app (ae/ps/ai/ppro/ch). Empty query lists everything. " +
|
|
149
|
+
"Consult this BEFORE attempting unusual scripting; it is cheaper than rediscovering a gotcha.",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
query: z.string().optional().describe("Keywords (empty = list all)."),
|
|
152
|
+
app: z.string().optional().describe("Filter: ae, ps, ai, ppro, ch."),
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
async ({ query, app }) => {
|
|
156
|
+
try {
|
|
157
|
+
const out = searchLessons(query || "", app).map((l) => ({
|
|
158
|
+
app: l.app,
|
|
159
|
+
title: l.title,
|
|
160
|
+
lesson: l.lesson,
|
|
161
|
+
...(l.example ? { example: l.example } : {}),
|
|
162
|
+
}));
|
|
163
|
+
return text({ count: out.length, lessons: out.slice(0, 25) });
|
|
164
|
+
} catch (e) {
|
|
165
|
+
return errText(e);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
server.registerTool(
|
|
171
|
+
"knowledge_add",
|
|
172
|
+
{
|
|
173
|
+
title: "Record a new lesson in the knowledge base",
|
|
174
|
+
description:
|
|
175
|
+
"Persist a scripting lesson/gotcha so future sessions (and other users of this install) benefit. " +
|
|
176
|
+
"Use after solving an error whose fix was NOT auto-suggested, or discovering a non-obvious technique. " +
|
|
177
|
+
"`match` keywords are matched against future error text to auto-surface the lesson — choose distinctive " +
|
|
178
|
+
"substrings of the error message (e.g. 'Illegal Parameter type').",
|
|
179
|
+
inputSchema: {
|
|
180
|
+
app: z.string().describe("ae, ps, ai, ppro, ch, or 'any'."),
|
|
181
|
+
title: z.string().describe("Short name for the lesson."),
|
|
182
|
+
lesson: z.string().describe("The gotcha and its fix, 1-3 sentences."),
|
|
183
|
+
match: z
|
|
184
|
+
.array(z.string())
|
|
185
|
+
.optional()
|
|
186
|
+
.describe("Error-text substrings that should auto-surface this lesson."),
|
|
187
|
+
example: z.string().optional().describe("Minimal working code example."),
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
async ({ app, title, lesson, match, example }) => {
|
|
191
|
+
try {
|
|
192
|
+
return text(addLesson({ app, title, lesson, match, example }));
|
|
193
|
+
} catch (e) {
|
|
194
|
+
return errText(e);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{"id":"ps-active-doc","app":"ps","title":"Active document switches silently between calls","match":["frontmost document"],"lesson":"Photoshop's active document can change between MCP calls (opens, previews, exports). Layers created via app.activeDocument can silently land in the WRONG open document with no error. Start every multi-document script with app.activeDocument = app.documents.getByName('target') and pass that reference around; layer edits on a non-frontmost doc throw 'target document is the frontmost document'.","example":"var doc = app.documents.getByName('poster'); app.activeDocument = doc;","added":"2026-07-14","source":"session"}
|
|
2
|
+
{"id":"ps-text-unitvalue","app":"ps","title":"Text layers need UnitValue sizes","match":["internal error"],"lesson":"Setting textItem.size (and position) with plain numbers can throw a generic 'Internal error'. Use new UnitValue(n, 'px') for size and position array elements. Set layer.kind = LayerKind.TEXT before touching textItem, and build the SolidColor fully before assigning it.","example":"t.size = new UnitValue(150, 'px'); t.position = [new UnitValue(960,'px'), new UnitValue(770,'px')];","added":"2026-07-14","source":"session"}
|
|
3
|
+
{"id":"ps-no-ellipse","app":"ps","title":"No ellipse selection in the DOM — use polygon circles","match":[],"lesson":"doc.selection has no ellipse method. Approximate circles with a many-point polygon passed to selection.select: 72 points is visually indistinguishable from a true circle. Then selection.stroke(color, width, StrokeLocation.INSIDE, ...) draws schematic rings.","example":"var pts=[]; for (var a=0;a<72;a++){var t=a/72*Math.PI*2; pts.push([cx+r*Math.cos(t), cy+r*Math.sin(t)]);} doc.selection.select(pts);","added":"2026-07-14","source":"session"}
|
|
4
|
+
{"id":"ps-removed-layer","app":"ps","title":"Referencing a removed layer throws 'Object is invalid'","match":["object is invalid"],"lesson":"After layer.remove(), any further property access on that reference throws. When sweeping layers by name in a loop, break out of inner matching loops immediately after remove(), and iterate collections downward (length-1 to 0).","added":"2026-07-14","source":"session"}
|
|
5
|
+
{"id":"ps-edge-lineart","app":"ps","title":"Smart Blur EDGEONLY = instant blueprint line art","match":[],"lesson":"artLayer.applySmartBlur(radius, threshold, SmartBlurQuality.HIGH, SmartBlurMode.EDGEONLY) converts a photo to white line-art on black — composite with BlendMode.SCREEN over a colored ground for blueprint/technical looks. Hard-edged isolated subjects extract best. For dark/silhouette sources, run adjustLevels contrast boost first and drop threshold to ~12; duplicate the SCREEN layer to intensify faint linework.","example":"lyr.desaturate(); lyr.adjustLevels(30,180,1.2,0,255); lyr.applySmartBlur(2,12,SmartBlurQuality.HIGH,SmartBlurMode.EDGEONLY);","added":"2026-07-14","source":"session"}
|
|
6
|
+
{"id":"ps-glass-refrakt","app":"ps","title":"Glass distortion (Refrakt look) is scriptable","match":[],"lesson":"artLayer.applyGlassEffect(distortion, smoothness, scaling, invert, TextureType.FROSTED) gives the trendy frosted-glass diffusion. For the ribbed/fluted-glass look, slice vertical strips with selection.select + selection.translate offset on a sine curve; carve 'clear pane' gaps with selection.clear to reveal the sharp layer beneath.","added":"2026-07-14","source":"session"}
|
|
7
|
+
{"id":"ps-glitch-strips","app":"ps","title":"Glitch / refraction via selection-translate strips","match":[],"lesson":"Select thin rects and doc.selection.translate them: horizontal strips with random offsets = glitch; vertical strips with sine offsets = ribbed glass refraction. Same primitive, rotated 90 degrees, covers two trend looks.","added":"2026-07-14","source":"session"}
|
|
8
|
+
{"id":"ps-halftone-gap","app":"ps","title":"Color Halftone filter is NOT in the scripting DOM","match":[],"lesson":"There is no applyColorHalftone. True halftone dots need low-level ActionManager (charIDToTypeID) calls. Posterize + AddNoise approximates the riso/zine feel scriptably; or ask the user to run Filter > Pixelate > Color Halftone by hand.","added":"2026-07-14","source":"session"}
|
|
9
|
+
{"id":"ps-paste-center","app":"ps","title":"paste() lands at the document center","match":[],"lesson":"doc.paste() places the pasted layer centered. Reposition by reading layer.bounds and translating by (targetCenter - currentCenter). Fit images into layout cells by resizing the SOURCE doc before copy (scale = min(maxW/w, maxH/h)).","added":"2026-07-14","source":"session"}
|
|
10
|
+
{"id":"ae-wiggly-selector","app":"ae","title":"Text wiggly selector matchName","match":["adbe text selector wiggly","can not add a property"],"lesson":"The wiggly selector matchName is 'ADBE Text Wiggly Selector' (not 'ADBE Text Selector Wiggly'). Range selector is 'ADBE Text Selector'; both live under animator.property('ADBE Text Selectors'). Animator properties (Position 3D, Rotation, Opacity) are added under 'ADBE Text Animator Properties'.","example":"anim.property('ADBE Text Selectors').addProperty('ADBE Text Wiggly Selector')","added":"2026-07-14","source":"session"}
|
|
11
|
+
{"id":"ae-seamless-loop","app":"ae","title":"Seamless loops via cycling Evolution","match":[],"lesson":"For Turbulent Displace / Fractal Noise loops: set the Evolution expression to time * (360 / compDuration) and enable Cycle Evolution with Cycle = 1 revolution — the noise field returns exactly to its start state. Keep any sway/bob expressions on sine periods that divide the comp duration. Verify by diffing first vs last frame of the render (ffmpeg blend=difference; YAVG < 1 is seamless).","example":"fx.property('Evolution').expression = 'time * 45;' // 8s comp = 360deg","added":"2026-07-14","source":"session"}
|
|
12
|
+
{"id":"ae-render-timeout","app":"ae","title":"AppleEvent timeout does not mean the render failed","match":["appleevent timed out","-1712"],"lesson":"ae_render_comp blocks on an AppleScript reply; long renders can outlive the reply timeout while AE keeps rendering. Before re-queueing, check the output file: stable byte size and correct duration (ffprobe) means it completed. Re-running would waste minutes.","added":"2026-07-14","source":"session"}
|
|
13
|
+
{"id":"ae-psd-import","app":"ae","title":"PSD comp import: durations and anchors need fixing","match":[],"lesson":"Importing a layered PSD as a comp: (1) nested comps (from PSD groups) inherit a short default duration — set .duration on every nested comp AND extend each layer's outPoint; (2) every layer is document-sized with its anchor at the doc center — to rotate a limb around a joint, get the layer's real pixel bounds from Photoshop and set anchorPoint AND position to that pivot (same value keeps it in place at scale 100).","added":"2026-07-14","source":"session"}
|
|
14
|
+
{"id":"ae-effect-matchnames","app":"ae","title":"Drive effects by matchName; params by index or display name","match":[],"lesson":"Effects.addProperty with matchNames: 'ADBE Turbulent Displace', 'ADBE Glo2' (Glow), 'ADBE Echo', 'ADBE Drop Shadow', 'ADBE 4ColorGradient', 'ADBE Fractal Noise'. Parameters address as '<matchName>-000N' (e.g. 'ADBE Echo-0001' = Echo Time) or by display name fx.property('Amount') in an English UI — wrap display-name access in try/catch.","added":"2026-07-14","source":"session"}
|
|
15
|
+
{"id":"ae-motion-blur","app":"ae","title":"Whips need motion blur enabled at both levels","match":[],"lesson":"Whip-pan and punch transitions read as cheap without motion blur. Set layer.motionBlur = true on the moving layers AND comp.motionBlur = true, with comp.shutterAngle 270-360 for heavy smear. Adjacent whips: move outgoing exactly one frame-width/height and the incoming from one screen away with LINEAR keys so the pair travels as a seamless strip.","added":"2026-07-14","source":"session"}
|
|
16
|
+
{"id":"ae-glow-blowout","app":"ae","title":"Glow on already-bright footage blows out white","match":[],"lesson":"Default 'ADBE Glo2' on neon/bright sources nukes the image to white. Check a saved frame after adding glow; usually the fix is removing it or drastically lowering intensity — and move light text OFF bright areas rather than fighting with effects.","added":"2026-07-14","source":"session"}
|
|
17
|
+
{"id":"ppro-autoreframe-string","app":"ppro","title":"autoReframeSequence motion preset is a STRING","match":["illegal parameter type"],"lesson":"sequence.autoReframeSequence(numerator, denominator, motionPreset, newName, useNested) throws 'Illegal Parameter type' if motionPreset is numeric — it must be the string 'default' (slower/faster variants exist). Working call: seq.autoReframeSequence(9, 16, 'default', 'Vertical', false). It runs real AI subject tracking and returns the new sequence.","example":"seq.autoReframeSequence(9, 16, 'default', 'Sting Vertical 9x16', false)","added":"2026-07-14","source":"session"}
|
|
18
|
+
{"id":"ppro-qe-transitions","app":"ppro","title":"QE DOM transitions: string list, byName lookup, addTransition","match":[],"lesson":"app.enableQE() first. qe.project.getVideoTransitionList() returns a plain ARRAY OF STRINGS (names). Get a transition with qe.project.getVideoTransitionByName(name), apply with qeClip.addTransition(trans, applyToStart, '00:00:00:12') — the timecode string sets duration. Iterate qeTrack.getItemAt(i) over numItems and skip items with empty names (gaps). Modern packs include Whip, Cross Zoom, Spin Motion, Flash, Glitch, VHS Damage, Zoom Blur.","added":"2026-07-14","source":"session"}
|
|
19
|
+
{"id":"ppro-pretrim-cuts","app":"ppro","title":"Build cut lists by pre-trimming project items","match":[],"lesson":"projectItem.setInPoint(seconds, 4) / setOutPoint(seconds, 4) before app.project.createNewSequenceFromClips(name, orderedItems) yields a butt-cut timeline honoring those trims — no post-hoc ripple editing needed. Premiere snaps to frame boundaries (expect ~30s to come out 29.92 at 25fps).","added":"2026-07-14","source":"session"}
|
|
20
|
+
{"id":"ppro-dynamiclink-name","app":"ppro","title":"Dynamic-linked AE comps import as 'Comp/Project.aep'","match":[],"lesson":"After importAEComps, the project item is named '<CompName>/<Project>.aep' — exact-name lookups fail. Match with name.indexOf(compName) === 0. Trim an overlay clip by assigning clip.end = (new Time() with .seconds set).","added":"2026-07-14","source":"session"}
|
|
21
|
+
{"id":"ppro-no-frame-export","app":"ppro","title":"exportFramePNG missing in some Premiere versions","match":["exportframepng"],"lesson":"Premiere 26.0 lacks the frame-export API used by ppro_save_frame. Verify sequences by exporting (ppro_export_sequence) and extracting frames from the file with ffmpeg instead.","added":"2026-07-14","source":"session"}
|
|
22
|
+
{"id":"ai-active-doc-export","app":"ai","title":"Illustrator exports act on the ACTIVE document","match":[],"lesson":"ai_export / ai_save_preview target whatever document is frontmost — other docs (or ones another tool opened) can be active. Before exporting, set app.activeDocument = app.documents.getByName(...) — or find the right doc by dimensions when names are Untitled. documents.add() also switches the active doc.","added":"2026-07-14","source":"session"}
|
|
23
|
+
{"id":"ai-scripted-blend","app":"ai","title":"No blend API — interpolate shapes in a loop","match":[],"lesson":"Illustrator scripting exposes no Blend objects. Fake blends/gradient meshes by generating N intermediate shapes with interpolated geometry and color (e.g. 46 concentric ellipses violet-to-cream = smooth 3D gradient orb). Faux-3D extruded type: stack dark offset text copies under the white top copy.","added":"2026-07-14","source":"session"}
|
|
24
|
+
{"id":"ai-coords","app":"ai","title":"Artboard coordinate system","match":[],"lesson":"artboardRect is [left, top, right, bottom] = [0, H, W, 0] — Y increases UPWARD, and pathItems.ellipse/rectangle(top, left, w, h) take top as the higher Y. Text position is the baseline start point. textFonts.getByName('Arial-BoldMT') in try/catch.","added":"2026-07-14","source":"session"}
|
|
25
|
+
{"id":"any-verify-visually","app":"any","title":"Verify visually at every stage","match":[],"lesson":"After each meaningful change, render a preview (ae_save_frame / ps_save_preview / ai_save_preview) and LOOK at it — wrong mouth shapes, blown-out glow, text over busy areas, and mis-parented layers are all invisible in return values. Verify final deliverables from the actual output file (ffmpeg frame extraction), not just the tool result.","added":"2026-07-14","source":"session"}
|
|
26
|
+
{"id":"any-pexels-sourcing","app":"any","title":"Pexels direct-download pattern for stock sourcing","match":[],"lesson":"https://images.pexels.com/photos/{id}/pexels-photo-{id}.jpeg?auto=compress&cs=tinysrgb&w=1600 downloads directly (free license, no attribution). Very old photo IDs can 404 (came back 27 bytes) — check file size/type after curl and keep an alternate ID. Choose isolated, high-contrast subjects when the image will be edge-extracted or cut out.","added":"2026-07-14","source":"session"}
|
|
27
|
+
{"id":"any-es3","app":"any","title":"ExtendScript is ES3","match":["json is undefined","is not a function"],"lesson":"No JSON object, let/const, arrow functions, template literals, Array.map/filter/forEach inside the apps. Use var, string concat, and index loops. AE collections are 1-indexed (comp.layer(1) is the top layer); PS artLayers are 0-indexed. The MCP harness JSON-serializes your return value for you.","added":"2026-07-14","source":"session"}
|
|
28
|
+
{"id":"ch-puppet-taxonomy","app":"ch","title":"Extra layers ride along in CH puppet groups","match":[],"lesson":"Character Animator auto-rigs from the layer-name taxonomy (+Character root, Head/Body groups, 14 visemes, Blink layers). Extra non-taxonomy layers (logos, badges) placed INSIDE a group (e.g. Body) simply ride with that group — safe way to add art to a rigged puppet. Remove stray empty layers at root before import.","added":"2026-07-14","source":"session"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ajsmonty/adobe-mcp",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "MCP server for Adobe CC apps (AE, PS, AI, Premiere, Character Animator) on macOS",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"adobe-mcp": "server.mjs"
|
|
8
|
+
},
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=18"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
14
|
+
"zod": "^3.24.1"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "AJ Montgomery",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/AJSMonty/adobe-mcp.git"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"mcp",
|
|
24
|
+
"model-context-protocol",
|
|
25
|
+
"adobe",
|
|
26
|
+
"after-effects",
|
|
27
|
+
"photoshop",
|
|
28
|
+
"illustrator",
|
|
29
|
+
"premiere-pro",
|
|
30
|
+
"extendscript"
|
|
31
|
+
],
|
|
32
|
+
"mcpName": "io.github.ajsmonty/adobe-mcp",
|
|
33
|
+
"files": [
|
|
34
|
+
"server.mjs",
|
|
35
|
+
"adapters/",
|
|
36
|
+
"core/",
|
|
37
|
+
"knowledge/",
|
|
38
|
+
"workflow/",
|
|
39
|
+
"scripts/",
|
|
40
|
+
"cep/",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE",
|
|
43
|
+
"SECURITY.md"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Kinetic Cascade Text — rigs the selected text layers with the 2026 kinetic-typography
|
|
2
|
+
// staple: per-character cascade-in (position + rotation + opacity through an eased range
|
|
3
|
+
// selector) plus a perpetual wiggly-selector jitter. Stagger multiple layers by selection order.
|
|
4
|
+
(function () {
|
|
5
|
+
var comp = app.project.activeItem;
|
|
6
|
+
if (!(comp instanceof CompItem) || !comp.selectedLayers.length) {
|
|
7
|
+
alert("Select text layer(s) in a comp first.");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
app.beginUndoGroup("Kinetic Cascade");
|
|
11
|
+
for (var i = 0; i < comp.selectedLayers.length; i++) {
|
|
12
|
+
var l = comp.selectedLayers[i];
|
|
13
|
+
if (!(l instanceof TextLayer)) continue;
|
|
14
|
+
var tIn = 0.2 + i * 0.6;
|
|
15
|
+
var dir = i % 2 === 0 ? -1 : 1;
|
|
16
|
+
var anim = l.Text.property("ADBE Text Animators").addProperty("ADBE Text Animator");
|
|
17
|
+
anim.name = "CascadeIn";
|
|
18
|
+
var props = anim.property("ADBE Text Animator Properties");
|
|
19
|
+
props.addProperty("ADBE Text Position 3D").setValue([0, dir * 350, 0]);
|
|
20
|
+
props.addProperty("ADBE Text Rotation").setValue(dir * 90);
|
|
21
|
+
props.addProperty("ADBE Text Opacity").setValue(0);
|
|
22
|
+
var sel = anim.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
|
|
23
|
+
var off = sel.property("ADBE Text Percent Offset");
|
|
24
|
+
off.setValueAtTime(tIn, -100);
|
|
25
|
+
off.setValueAtTime(tIn + 1.1, 100);
|
|
26
|
+
try {
|
|
27
|
+
sel.property("ADBE Text Range Advanced").property("ADBE Text Levels Max Ease").setValue(85);
|
|
28
|
+
sel.property("ADBE Text Range Advanced").property("ADBE Text Levels Min Ease").setValue(30);
|
|
29
|
+
} catch (e) {}
|
|
30
|
+
var anim2 = l.Text.property("ADBE Text Animators").addProperty("ADBE Text Animator");
|
|
31
|
+
anim2.name = "Jitter";
|
|
32
|
+
var props2 = anim2.property("ADBE Text Animator Properties");
|
|
33
|
+
props2.addProperty("ADBE Text Position 3D").setValue([0, 14, 0]);
|
|
34
|
+
props2.addProperty("ADBE Text Rotation").setValue(6);
|
|
35
|
+
// NOTE matchName: "ADBE Text Wiggly Selector" (not "Selector Wiggly")
|
|
36
|
+
var wig = anim2.property("ADBE Text Selectors").addProperty("ADBE Text Wiggly Selector");
|
|
37
|
+
try { wig.property("ADBE Text Wiggly Frequency").setValue(2.2); } catch (e) {}
|
|
38
|
+
l.motionBlur = true;
|
|
39
|
+
}
|
|
40
|
+
comp.motionBlur = true;
|
|
41
|
+
app.endUndoGroup();
|
|
42
|
+
})();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Wind Loop (Turbulent) — makes the selected layers ripple as if blowing in the wind,
|
|
2
|
+
// looping seamlessly over the comp duration. Adds Turbulent Displace with a cycling
|
|
3
|
+
// Evolution (one full revolution per comp loop) plus loop-safe sway and bob expressions.
|
|
4
|
+
(function () {
|
|
5
|
+
var comp = app.project.activeItem;
|
|
6
|
+
if (!(comp instanceof CompItem) || !comp.selectedLayers.length) {
|
|
7
|
+
alert("Select layer(s) in a comp first.");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
app.beginUndoGroup("Wind Loop");
|
|
11
|
+
var degPerSec = 360 / comp.duration;
|
|
12
|
+
for (var i = 0; i < comp.selectedLayers.length; i++) {
|
|
13
|
+
var l = comp.selectedLayers[i];
|
|
14
|
+
var fx = l.property("ADBE Effect Parade").addProperty("ADBE Turbulent Displace");
|
|
15
|
+
fx.property("Amount").setValue(12);
|
|
16
|
+
fx.property("Size").setValue(150);
|
|
17
|
+
fx.property("Complexity").setValue(1.3);
|
|
18
|
+
try {
|
|
19
|
+
fx.property("Cycle Evolution").setValue(1);
|
|
20
|
+
fx.property("Cycle (in Revolutions)").setValue(1);
|
|
21
|
+
} catch (e) {}
|
|
22
|
+
fx.property("Evolution").expression = "time * " + degPerSec + ";";
|
|
23
|
+
l.rotation.expression =
|
|
24
|
+
"1.2 * Math.sin(time * Math.PI * 2 / " + comp.duration + ");";
|
|
25
|
+
l.position.expression =
|
|
26
|
+
"value + [0, 5 * Math.sin(time * Math.PI * 4 / " + comp.duration + ")];";
|
|
27
|
+
l.motionBlur = true;
|
|
28
|
+
}
|
|
29
|
+
app.endUndoGroup();
|
|
30
|
+
})();
|