diff --git a/cep.config.ts b/cep.config.ts index e371ba4..59fdc69 100644 --- a/cep.config.ts +++ b/cep.config.ts @@ -13,26 +13,15 @@ const config: CEP_Config = { extensionManifestVersion: 6.0, requiredRuntimeVersion: 9.0, hosts: [ - { - name: "AEFT", - version: "[0.0,99.9]", - }, - { - name: "PPRO", - version: "[0.0,99.9]", - }, - { - name: "ILST", - version: "[0.0,99.9]", - }, - { - name: "PHXS", - version: "[0.0,99.9]", - }, - { - name: "FLPR", - version: "[0.0,99.9]", - }, + { name: "AEFT", version: "[0.0,99.9]" }, + { name: "AME", version: "[0.0,99.9]" }, + { name: "AUDT", version: "[0.0,99.9]" }, + { name: "FLPR", version: "[0.0,99.9]" }, + { name: "IDSN", version: "[0.0,99.9]" }, + { name: "ILST", version: "[0.0,99.9]" }, + { name: "KBRG", version: "[0.0,99.9]" }, + { name: "PHXS", version: "[0.0,99.9]" }, + { name: "PPRO", version: "[0.0,99.9]" }, ], type: "Panel", diff --git a/src/jsx/ame/ame.ts b/src/jsx/ame/ame.ts new file mode 100644 index 0000000..d7ef9d3 --- /dev/null +++ b/src/jsx/ame/ame.ts @@ -0,0 +1,3 @@ +export const helloWorld = () => { + alert("Hello from Media Encoder"); +}; diff --git a/src/jsx/ame/tsconfig.json b/src/jsx/ame/tsconfig.json new file mode 100644 index 0000000..acbbcc4 --- /dev/null +++ b/src/jsx/ame/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es3", + "noLib": true, + "strict": true, + "types": [ + "../global", + "../../../node_modules/types-for-adobe/shared/global" + ] + }, + "include": ["./**/*"] +} diff --git a/src/jsx/audt/audt.ts b/src/jsx/audt/audt.ts new file mode 100644 index 0000000..0651241 --- /dev/null +++ b/src/jsx/audt/audt.ts @@ -0,0 +1,3 @@ +export const helloWorld = () => { + alert("Hello from Audtion"); +}; diff --git a/src/jsx/audt/tsconfig.json b/src/jsx/audt/tsconfig.json new file mode 100644 index 0000000..944a0a1 --- /dev/null +++ b/src/jsx/audt/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es3", + "noLib": true, + "strict": true, + "types": [ + "../global", + "../../../node_modules/types-for-adobe/Audition/2018" + ] + }, + "include": ["./**/*"] +} diff --git a/src/jsx/idsn/idsn.ts b/src/jsx/idsn/idsn.ts new file mode 100644 index 0000000..69956df --- /dev/null +++ b/src/jsx/idsn/idsn.ts @@ -0,0 +1,3 @@ +export const helloWorld = () => { + alert("Hello from InDesign"); +}; diff --git a/src/jsx/idsn/tsconfig.json b/src/jsx/idsn/tsconfig.json new file mode 100644 index 0000000..682adce --- /dev/null +++ b/src/jsx/idsn/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es3", + "noLib": true, + "strict": true, + "types": [ + "../global", + "../../../node_modules/types-for-adobe/InDesign/2021" + ] + }, + "include": ["./**/*"] +} diff --git a/src/jsx/index.ts b/src/jsx/index.ts index de030c6..bc5499c 100644 --- a/src/jsx/index.ts +++ b/src/jsx/index.ts @@ -3,43 +3,94 @@ import { ns } from "../shared/shared"; import * as aeft from "./aeft/aeft"; -import * as ilst from "./ilst/ilst"; +import * as ame from "./ame/ame"; import * as anim from "./anim/anim"; -import * as ppro from "./ppro/ppro"; +import * as audt from "./audt/audt"; +import * as idsn from "./idsn/idsn"; +import * as ilst from "./ilst/ilst"; +import * as kbrg from "./kbrg/kbrg"; import * as phxs from "./phxs/phxs"; +import * as ppro from "./ppro/ppro"; -let main: any; +//@ts-ignore +const host = typeof $ !== "undefined" ? $ : window; -switch (BridgeTalk.appName) { - case "premierepro": - case "premiereprobeta": - main = ppro; - break; +switch (BridgeTalk.appName as ApplicationName) { case "aftereffects": case "aftereffectsbeta": - main = aeft; + host[ns] = aeft; + break; + + case "ame": + case "amebeta": + host[ns] = ame; + break; + + case "audition": + case "auditionbeta": + host[ns] = audt; + break; + + case "bridge": + case "bridgebeta": + host[ns] = kbrg; break; + case "illustrator": case "illustratorbeta": - main = ilst; + host[ns] = ilst; + break; + + case "indesign": + case "indesignbeta": + host[ns] = idsn; break; + case "photoshop": case "photoshopbeta": - main = phxs; + host[ns] = phxs; + break; + + case "premierepro": + case "premiereprobeta": + host[ns] = ppro; break; + default: //@ts-ignore if (app.appName === "Adobe Animate") { - main = anim; + host[ns] = anim; } break; } -//@ts-ignore -const host = typeof $ !== "undefined" ? $ : window; -host[ns] = main; export type Scripts = typeof aeft & - typeof ilst & + typeof ame & typeof anim & - typeof ppro & - typeof phxs; + typeof audt & + typeof idsn & + typeof ilst & + typeof kbrg & + typeof phxs & + typeof ppro; + +// https://extendscript.docsforadobe.dev/interapplication-communication/bridgetalk-class.html?highlight=bridgetalk#appname +type ApplicationName = + | "aftereffects" + | "aftereffectsbeta" + | "ame" + | "amebeta" + | "audition" + | "auditionbeta" + | "bridge" + | "bridgebeta" + // | "flash" + | "illustrator" + | "illustratorbeta" + | "indesign" + | "indesignbeta" + // | "indesignserver" + | "photoshop" + | "photoshopbeta" + | "premierepro" + | "premiereprobeta"; diff --git a/src/jsx/kbrg/kbrg.ts b/src/jsx/kbrg/kbrg.ts new file mode 100644 index 0000000..57ee0d7 --- /dev/null +++ b/src/jsx/kbrg/kbrg.ts @@ -0,0 +1,3 @@ +export const helloWorld = () => { + alert("Hello from Bridge"); +}; diff --git a/src/jsx/kbrg/tsconfig.json b/src/jsx/kbrg/tsconfig.json new file mode 100644 index 0000000..acbbcc4 --- /dev/null +++ b/src/jsx/kbrg/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es3", + "noLib": true, + "strict": true, + "types": [ + "../global", + "../../../node_modules/types-for-adobe/shared/global" + ] + }, + "include": ["./**/*"] +}