Skip to content

Commit

Permalink
Additional apps (hyperbrew#104) (hyperbrew#106)
Browse files Browse the repository at this point in the history
* add `ame`, `audt`, `idsn`, `kbrg` folders

* add new hosts to cep config

* removing use of `main`

* add `shared/global` types for apps w/o types
  • Loading branch information
fartinmartin authored Oct 24, 2023
1 parent c4ce369 commit a1437e8
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 38 deletions.
29 changes: 9 additions & 20 deletions cep.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/jsx/ame/ame.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const helloWorld = () => {
alert("Hello from Media Encoder");
};
12 changes: 12 additions & 0 deletions src/jsx/ame/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es3",
"noLib": true,
"strict": true,
"types": [
"../global",
"../../../node_modules/types-for-adobe/shared/global"
]
},
"include": ["./**/*"]
}
3 changes: 3 additions & 0 deletions src/jsx/audt/audt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const helloWorld = () => {
alert("Hello from Audtion");
};
12 changes: 12 additions & 0 deletions src/jsx/audt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es3",
"noLib": true,
"strict": true,
"types": [
"../global",
"../../../node_modules/types-for-adobe/Audition/2018"
]
},
"include": ["./**/*"]
}
3 changes: 3 additions & 0 deletions src/jsx/idsn/idsn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const helloWorld = () => {
alert("Hello from InDesign");
};
12 changes: 12 additions & 0 deletions src/jsx/idsn/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es3",
"noLib": true,
"strict": true,
"types": [
"../global",
"../../../node_modules/types-for-adobe/InDesign/2021"
]
},
"include": ["./**/*"]
}
87 changes: 69 additions & 18 deletions src/jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
3 changes: 3 additions & 0 deletions src/jsx/kbrg/kbrg.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const helloWorld = () => {
alert("Hello from Bridge");
};
12 changes: 12 additions & 0 deletions src/jsx/kbrg/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es3",
"noLib": true,
"strict": true,
"types": [
"../global",
"../../../node_modules/types-for-adobe/shared/global"
]
},
"include": ["./**/*"]
}

0 comments on commit a1437e8

Please sign in to comment.