@synthetic-ai/ae-mcp 2.4.4 → 2.4.8
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/dist/bridge.mjs +1 -1
- package/dist/server.mjs +2 -2
- package/dist/store.mjs +1 -1
- package/package.json +51 -50
- package/scripts/ae-dialogs.ps1 +129 -0
package/dist/store.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0xd728ab,_0xc84d48){const _0x725108={_0x135203:0x3a0,_0x19c245:0x397,_0x7b098e:0x32e,_0xfb62c6:0x39e,_0x2d6b12:0x330,_0x191032:0x337,_0xbe5e74:0x383,_0xbb5cc3:0x37d,_0x2764ad:0x31e,_0x388a6f:0x38f,_0x3a0395:0x382},_0x51dabd={_0x540cca:0x206},_0x3c5174={_0x2845d9:0x1aa};function _0x4fbaf2(_0x5dc821,_0x2a22be){return _0x27a5(_0x5dc821-_0x3c5174._0x2845d9,_0x2a22be);}function _0x112f1d(_0xdb6735,_0x26981e){return _0x27a5(_0xdb6735-_0x51dabd._0x540cca,_0x26981e);}const _0x47151a=_0xd728ab();while(!![]){try{const _0x4a1c0b=-parseInt(_0x112f1d(0x39c,_0x725108._0x135203))/0x1*(-parseInt(_0x112f1d(_0x725108._0x19c245,0x398))/0x2)+-parseInt(_0x112f1d(0x387,0x37e))/0x3+-parseInt(_0x4fbaf2(_0x725108._0x7b098e,0x328))/0x4+-parseInt(_0x112f1d(0x39b,_0x725108._0xfb62c6))/0x5+-parseInt(_0x4fbaf2(0x346,0x336))/0x6*(parseInt(_0x4fbaf2(_0x725108._0x2d6b12,_0x725108._0x191032))/0x7)+-parseInt(_0x112f1d(_0x725108._0xbe5e74,_0x725108._0xbb5cc3))/0x8+-parseInt(_0x4fbaf2(0x32f,_0x725108._0x2764ad))/0x9*(-parseInt(_0x112f1d(_0x725108._0x388a6f,_0x725108._0x3a0395))/0xa);if(_0x4a1c0b===_0xc84d48)break;else _0x47151a['push'](_0x47151a['shift']());}catch(_0x2f2057){_0x47151a['push'](_0x47151a['shift']());}}}(_0x1a83,0xf06d3));import{homedir}from'node:os';function _0x156a41(_0x5f4221,_0x40ba9f){return _0x27a5(_0x40ba9f-0x30,_0x5f4221);}import{join}from'node:path';import{existsSync,mkdirSync,appendFileSync,readFileSync,writeFileSync}from'node:fs';export const DATA_DIR=process.env.AE_MCP_DATA_DIR||join(homedir(),_0x38ed92(0x4a2,0x497));export const JOURNAL_PATH=join(DATA_DIR,_0x156a41(0x1c5,0x1c3));export const WRAPPERS_PATH=join(DATA_DIR,_0x38ed92(0x4b3,0x4a6));function ensureDir(){if(!existsSync(DATA_DIR))mkdirSync(DATA_DIR,{'recursive':!![]});}export function appendJournal(_0x2e1483){function _0x5b48c5(_0x3ae714,_0xc660b8){return _0x156a41(_0x3ae714,_0xc660b8- -0x414);}try{ensureDir(),appendFileSync(JOURNAL_PATH,JSON[_0x5b48c5(-0x25c,-0x25d)](_0x2e1483)+'\x0a','utf-8');}catch(_0x494d71){}}export function readJournal(){const _0x42b7e5={_0x4f01d0:0x2dd},_0x1b72df={_0x55ff81:0x262};function _0x23435a(_0xa99e9,_0xe10cfc){return _0x156a41(_0xe10cfc,_0xa99e9-0x12a);}function _0x5bf691(_0x493af5,_0x5db685){return _0x156a41(_0x5db685,_0x493af5- -_0x1b72df._0x55ff81);}if(!existsSync(JOURNAL_PATH))return[];const _0x20358f=[];for(const _0x4059da of readFileSync(JOURNAL_PATH,'utf-8')['split']('\x0a')){const _0x13a41a=_0x4059da[_0x23435a(0x2e4,_0x42b7e5._0x4f01d0)]();if(!_0x13a41a)continue;try{_0x20358f['push'](JSON[_0x5bf691(-0xa5,-0xad)](_0x13a41a));}catch(_0x2053f6){}}return _0x20358f;}function _0x38ed92(_0x255233,_0x20e140){const _0x3e4679={_0x67782b:0x317};return _0x27a5(_0x20e140-_0x3e4679._0x67782b,_0x255233);}export function readWrappers(){const _0x15846c={_0x1ed269:0x1f3,_0x6ed179:0xc4,_0x4819b7:0xc5,_0x34e895:0xd5,_0x2d9950:0xe2},_0x345ea2={_0x4a9588:0x3d2};function _0xa954a2(_0x5daa9c,_0x1e2d1b){return _0x38ed92(_0x5daa9c,_0x1e2d1b- -0x697);}if(!existsSync(WRAPPERS_PATH))return[];function _0xa6b183(_0x250ae0,_0x43fecc){return _0x38ed92(_0x43fecc,_0x250ae0- -_0x345ea2._0x4a9588);}try{const _0x2e7629=JSON[_0xa954a2(-0x1e3,-_0x15846c._0x1ed269)](readFileSync(WRAPPERS_PATH,_0xa6b183(_0x15846c._0x6ed179,_0x15846c._0x4819b7)));return Array[_0xa6b183(_0x15846c._0x34e895,_0x15846c._0x2d9950)](_0x2e7629)?_0x2e7629:[];}catch(_0x43415b){return[];}}export function writeWrappers(_0x400157){const _0x2e6f59={_0x343150:0x90,_0x2f2a47:0x80};function _0x2b1739(_0x24238f,_0x140695){return _0x156a41(_0x140695,_0x24238f- -0x29c);}ensureDir();function _0x872329(_0x24c57e,_0x4ada0f){return _0x156a41(_0x4ada0f,_0x24c57e- -0x11f);}writeFileSync(WRAPPERS_PATH,JSON[_0x2b1739(-0xe5,-0xd6)](_0x400157,null,0x2),_0x872329(_0x2e6f59._0x343150,_0x2e6f59._0x2f2a47));}function _0x1a83(){const _0x41bc2a=['D3jHChbLCNmUANnVBG','AxnbCNjHEq','mZK0DMftDgrV','DhLWzq','AM91CM5HBc5QC29UBa','AM9PBG','mtK1ntmYnu5YDeT5uW','nZi1m0rRAM1Ata','ChjVDg90ExbL','yxjYyxK','CMf3','ChvZAa','twLZC2LUzYbYzxf1AxjLzcbWyxjHBwv0zxiGjW','mte0mZa2tLvJt21y','BNvTyMvY','icbBChjVBw90zwqGD3jHChbLCL0','nJCZmJeYoe93EMr2tW','CMvXDwLYzwq','DxrMltG','lNn5BNrOzxrPyY1Hzs1Ty3a','mJi5mJC4m1b6rNHSra','BMfTzq','zgvZy3jPChrPB24','mJK1mdy1nKrgr1jLDG','mZmXmZa1nZvrt2zJtK4','nteXENrSs2Hb','C3rYAw5NAwz5','C3rYAw5N','mtbxAfnhv1i','DhjPBq','CgfYyw1Z','B2jQzwn0','CgfYC2u','yM9VBgvHBG'];_0x1a83=function(){return _0x41bc2a;};return _0x1a83();}const TYPE_TO_SCHEMA={'string':()=>({'type':_0x38ed92(0x494,0x49f)}),'number':()=>({'type':_0x38ed92(0x4ab,0x4b4)}),'boolean':()=>({'type':_0x38ed92(0x4ae,0x4a5)}),'array':()=>({'type':_0x156a41(0x1d8,0x1c8)}),'object':()=>({'type':_0x156a41(0x1cc,0x1bc)}),'raw':()=>({'type':'string'})};function _0x27a5(_0x18f2aa,_0x5d5c99){_0x18f2aa=_0x18f2aa-0x17c;const _0x1a83ee=_0x1a83();let _0x27a50e=_0x1a83ee[_0x18f2aa];if(_0x27a5['SmjeQv']===undefined){var _0x1135e0=function(_0x2ac29c){const _0x2824d4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2e1483='',_0x494d71='';for(let _0x20358f=0x0,_0x4059da,_0x13a41a,_0x2053f6=0x0;_0x13a41a=_0x2ac29c['charAt'](_0x2053f6++);~_0x13a41a&&(_0x4059da=_0x20358f%0x4?_0x4059da*0x40+_0x13a41a:_0x13a41a,_0x20358f++%0x4)?_0x2e1483+=String['fromCharCode'](0xff&_0x4059da>>(-0x2*_0x20358f&0x6)):0x0){_0x13a41a=_0x2824d4['indexOf'](_0x13a41a);}for(let _0x2e7629=0x0,_0x43415b=_0x2e1483['length'];_0x2e7629<_0x43415b;_0x2e7629++){_0x494d71+='%'+('00'+_0x2e1483['charCodeAt'](_0x2e7629)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x494d71);};_0x27a5['ulkYYq']=_0x1135e0,_0x27a5['RJNXAO']={},_0x27a5['SmjeQv']=!![];}const _0x20bcf9=_0x1a83ee[0x0],_0x2d585a=_0x18f2aa+_0x20bcf9,_0x37c995=_0x27a5['RJNXAO'][_0x2d585a];return!_0x37c995?(_0x27a50e=_0x27a5['ulkYYq'](_0x27a50e),_0x27a5['RJNXAO'][_0x2d585a]=_0x27a50e):_0x27a50e=_0x37c995,_0x27a50e;}export function wrapperToToolDef(_0x4f58d3){const _0x1b913b={_0x12ec4d:0x5d,_0x242b58:0x13a,_0x6e43ab:0x14a,_0x2a9408:0x14a,_0x3e7be8:0x149,_0x1a7913:0x140,_0x4cbbfc:0x39,_0x12fb0c:0x47,_0x17dfa5:0x55,_0x5e9482:0x50,_0x50b77c:0x13e},_0x4824b6={_0x1f4155:0x207};function _0x19e263(_0x58fac5,_0x3ef01c){return _0x156a41(_0x3ef01c,_0x58fac5- -_0x4824b6._0x1f4155);}const _0x480a0c={};function _0x25505a(_0x143d96,_0x10a1a4){return _0x156a41(_0x10a1a4,_0x143d96- -0x2fc);}const _0x27e797=[];for(const _0x491bc7 of _0x4f58d3[_0x19e263(-0x4c,-_0x1b913b._0x12ec4d)]||[]){const _0xf5468a=(TYPE_TO_SCHEMA[_0x491bc7[_0x25505a(-_0x1b913b._0x242b58,-0x129)]]||TYPE_TO_SCHEMA[_0x25505a(-0x144,-0x14c)])();_0x480a0c[_0x491bc7[_0x25505a(-_0x1b913b._0x6e43ab,-_0x1b913b._0x2a9408)]]={..._0xf5468a,'description':_0x491bc7[_0x25505a(-_0x1b913b._0x3e7be8,-_0x1b913b._0x1a7913)]||''};if(_0x491bc7[_0x19e263(-0x59,-0x4e)])_0x27e797[_0x19e263(-0x3d,-_0x1b913b._0x4cbbfc)](_0x491bc7[_0x19e263(-0x55,-_0x1b913b._0x12fb0c)]);}return{'name':_0x4f58d3[_0x19e263(-_0x1b913b._0x17dfa5,-_0x1b913b._0x5e9482)],'description':(_0x4f58d3[_0x19e263(-0x54,-0x61)]||'')+_0x25505a(-0x150,-0x150),'inputSchema':{'type':_0x25505a(-_0x1b913b._0x1a7913,-_0x1b913b._0x50b77c),'properties':_0x480a0c,'required':_0x27e797,'additionalProperties':![]}};}function renderLiteral(_0x2f988b,_0x1dc8cf){const _0x3e2fdf={_0x47236e:0x1fb,_0x11035e:0x205,_0x38b969:0x206,_0x4af8bf:0x1f0,_0x333c53:0x201,_0x21775f:0x213,_0x319275:0x1fd},_0x323023={_0x498522:0x3d3},_0x4bdf2f={_0x8421a7:0x3bd};function _0x447e4f(_0x12824b,_0x564072){return _0x156a41(_0x12824b,_0x564072- -_0x4bdf2f._0x8421a7);}function _0x141366(_0x29ddb0,_0x14444f){return _0x156a41(_0x14444f,_0x29ddb0- -_0x323023._0x498522);}switch(_0x1dc8cf){case _0x447e4f(-_0x3e2fdf._0x47236e,-_0x3e2fdf._0x11035e):return JSON[_0x447e4f(-0x215,-_0x3e2fdf._0x38b969)](String(_0x2f988b??''));case _0x447e4f(-0x1ec,-_0x3e2fdf._0x4af8bf):return String(Number(_0x2f988b));case'boolean':return _0x2f988b?'true':'false';case'array':case _0x447e4f(-0x210,-_0x3e2fdf._0x333c53):return JSON[_0x447e4f(-0x216,-0x206)](_0x2f988b??null);case _0x141366(-0x20a,-_0x3e2fdf._0x21775f):return String(_0x2f988b??'');default:return JSON[_0x447e4f(-_0x3e2fdf._0x319275,-_0x3e2fdf._0x38b969)](String(_0x2f988b??''));}}export function fillTemplate(_0x2de443,_0x3c4c4f){const _0x121dc6={_0x4d48b8:0x2dc,_0x5ae056:0x2d2,_0x4c008f:0x15f,_0x1f5690:0x15f,_0x4b45c4:0x2cf,_0x2e6bc2:0x2f1,_0x137f82:0x2d8,_0x5c8cf3:0x2e3,_0x3339af:0x171},_0x500236={_0x5695bb:0x1c6};let _0x325dbc=_0x2de443['code'];for(const _0x47b6a9 of _0x2de443[_0x174000(_0x121dc6._0x4d48b8,_0x121dc6._0x5ae056)]||[]){const _0x4d3c26=_0x3c4c4f&&Object[_0x174000(0x2e8,0x2dd)]['hasOwnProperty']['call'](_0x3c4c4f,_0x47b6a9[_0x240bcc(_0x121dc6._0x4c008f,_0x121dc6._0x1f5690)]);let _0x3e7561=_0x4d3c26?_0x3c4c4f[_0x47b6a9[_0x240bcc(0x170,0x15f)]]:_0x47b6a9['default'];if(_0x3e7561===undefined){if(_0x47b6a9[_0x174000(_0x121dc6._0x4b45c4,0x2c0)])throw new Error(_0x174000(0x2ec,_0x121dc6._0x2e6bc2)+_0x47b6a9[_0x174000(0x2d3,_0x121dc6._0x137f82)]+'\x27');continue;}const _0x430019=renderLiteral(_0x3e7561,_0x47b6a9[_0x174000(_0x121dc6._0x5c8cf3,0x2f1)]);_0x325dbc=_0x325dbc['split']('{{'+_0x47b6a9[_0x174000(0x2d3,0x2de)]+'}}')[_0x240bcc(0x16d,_0x121dc6._0x3339af)](_0x430019);}function _0x240bcc(_0x214186,_0x11348d){return _0x38ed92(_0x214186,_0x11348d- -0x33a);}function _0x174000(_0x446024,_0x229530){return _0x38ed92(_0x229530,_0x446024- -_0x500236._0x5695bb);}return _0x325dbc;}
|
package/package.json
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@synthetic-ai/ae-mcp",
|
|
3
|
-
"version": "2.4.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "Control Adobe After Effects with 220+ AI tools via MCP. Two modes: Standalone (npx, no AE open) or Panel (CEP bridge, instant). By Synthetic (synthetic.com.ar).",
|
|
6
|
-
"homepage": "https://synthetic.com.ar/ae-mcp",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/matiasEltrece/after-effects-mcp"
|
|
10
|
-
},
|
|
11
|
-
"author": "Synthetic <hola@synthetic.com.ar> (https://synthetic.com.ar)",
|
|
12
|
-
"license": "UNLICENSED",
|
|
13
|
-
"keywords": [
|
|
14
|
-
"mcp",
|
|
15
|
-
"after-effects",
|
|
16
|
-
"adobe",
|
|
17
|
-
"jsx",
|
|
18
|
-
"extendscript",
|
|
19
|
-
"model-context-protocol",
|
|
20
|
-
"claude",
|
|
21
|
-
"ai",
|
|
22
|
-
"synthetic"
|
|
23
|
-
],
|
|
24
|
-
"main": "./dist/server.mjs",
|
|
25
|
-
"bin": {
|
|
26
|
-
"ae-mcp": "./dist/server.mjs"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"dist/server.mjs",
|
|
30
|
-
"dist/bridge.mjs",
|
|
31
|
-
"dist/store.mjs"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@synthetic-ai/ae-mcp",
|
|
3
|
+
"version": "2.4.8",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Control Adobe After Effects with 220+ AI tools via MCP. Two modes: Standalone (npx, no AE open) or Panel (CEP bridge, instant). By Synthetic (synthetic.com.ar).",
|
|
6
|
+
"homepage": "https://synthetic.com.ar/ae-mcp",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/matiasEltrece/after-effects-mcp"
|
|
10
|
+
},
|
|
11
|
+
"author": "Synthetic <hola@synthetic.com.ar> (https://synthetic.com.ar)",
|
|
12
|
+
"license": "UNLICENSED",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"mcp",
|
|
15
|
+
"after-effects",
|
|
16
|
+
"adobe",
|
|
17
|
+
"jsx",
|
|
18
|
+
"extendscript",
|
|
19
|
+
"model-context-protocol",
|
|
20
|
+
"claude",
|
|
21
|
+
"ai",
|
|
22
|
+
"synthetic"
|
|
23
|
+
],
|
|
24
|
+
"main": "./dist/server.mjs",
|
|
25
|
+
"bin": {
|
|
26
|
+
"ae-mcp": "./dist/server.mjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/server.mjs",
|
|
30
|
+
"dist/bridge.mjs",
|
|
31
|
+
"dist/store.mjs",
|
|
32
|
+
"scripts/ae-dialogs.ps1"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "node scripts/build.mjs",
|
|
36
|
+
"prepublishOnly": "npm run build",
|
|
37
|
+
"check": "node --check src/server.mjs",
|
|
38
|
+
"inspect:tools": "node scripts/inspect-tools.mjs",
|
|
39
|
+
"smoke": "node scripts/smoke-suite.mjs",
|
|
40
|
+
"package-cep": "node scripts/package-cep.mjs"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"javascript-obfuscator": "^5.4.3"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[ValidateSet("list", "close")]
|
|
3
|
+
[string]$Mode = "list",
|
|
4
|
+
[string]$TitlePattern = "^After Effects$",
|
|
5
|
+
[string]$ButtonPattern = "Aceptar|OK|Accept|Cerrar|Close",
|
|
6
|
+
[switch]$All
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
$ErrorActionPreference = "Stop"
|
|
10
|
+
|
|
11
|
+
Add-Type -AssemblyName UIAutomationClient
|
|
12
|
+
Add-Type -AssemblyName UIAutomationTypes
|
|
13
|
+
|
|
14
|
+
function Convert-Rect($rect) {
|
|
15
|
+
@{
|
|
16
|
+
left = $rect.Left
|
|
17
|
+
top = $rect.Top
|
|
18
|
+
width = $rect.Width
|
|
19
|
+
height = $rect.Height
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function Get-DescendantText($element) {
|
|
24
|
+
$texts = @()
|
|
25
|
+
$condition = [System.Windows.Automation.Condition]::TrueCondition
|
|
26
|
+
$children = $element.FindAll([System.Windows.Automation.TreeScope]::Descendants, $condition)
|
|
27
|
+
|
|
28
|
+
foreach ($child in $children) {
|
|
29
|
+
$name = $child.Current.Name
|
|
30
|
+
$controlType = $child.Current.ControlType.ProgrammaticName
|
|
31
|
+
if ($name -and $name.Trim().Length -gt 0 -and ($controlType -match "Text|Button|Edit|Document")) {
|
|
32
|
+
$trimmed = $name.Trim()
|
|
33
|
+
if ($texts -notcontains $trimmed) {
|
|
34
|
+
$texts += $trimmed
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return $texts
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function Get-DialogButtons($element) {
|
|
43
|
+
$buttons = @()
|
|
44
|
+
$condition = New-Object System.Windows.Automation.PropertyCondition(
|
|
45
|
+
[System.Windows.Automation.AutomationElement]::ControlTypeProperty,
|
|
46
|
+
[System.Windows.Automation.ControlType]::Button
|
|
47
|
+
)
|
|
48
|
+
$items = $element.FindAll([System.Windows.Automation.TreeScope]::Descendants, $condition)
|
|
49
|
+
|
|
50
|
+
foreach ($button in $items) {
|
|
51
|
+
$buttons += [pscustomobject]@{
|
|
52
|
+
name = $button.Current.Name
|
|
53
|
+
automationId = $button.Current.AutomationId
|
|
54
|
+
enabled = $button.Current.IsEnabled
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return $buttons
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function Invoke-DialogButton($element, $pattern) {
|
|
62
|
+
$condition = New-Object System.Windows.Automation.PropertyCondition(
|
|
63
|
+
[System.Windows.Automation.AutomationElement]::ControlTypeProperty,
|
|
64
|
+
[System.Windows.Automation.ControlType]::Button
|
|
65
|
+
)
|
|
66
|
+
$buttons = $element.FindAll([System.Windows.Automation.TreeScope]::Descendants, $condition)
|
|
67
|
+
|
|
68
|
+
foreach ($button in $buttons) {
|
|
69
|
+
if ($button.Current.Name -match $pattern -and $button.Current.IsEnabled) {
|
|
70
|
+
$invokePattern = $button.GetCurrentPattern([System.Windows.Automation.InvokePattern]::Pattern)
|
|
71
|
+
$invokePattern.Invoke()
|
|
72
|
+
return $button.Current.Name
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return $null
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
$root = [System.Windows.Automation.AutomationElement]::RootElement
|
|
80
|
+
$windowCondition = New-Object System.Windows.Automation.PropertyCondition(
|
|
81
|
+
[System.Windows.Automation.AutomationElement]::ControlTypeProperty,
|
|
82
|
+
[System.Windows.Automation.ControlType]::Window
|
|
83
|
+
)
|
|
84
|
+
$windows = $root.FindAll([System.Windows.Automation.TreeScope]::Children, $windowCondition)
|
|
85
|
+
$dialogs = @()
|
|
86
|
+
|
|
87
|
+
foreach ($window in $windows) {
|
|
88
|
+
$name = $window.Current.Name
|
|
89
|
+
$className = $window.Current.ClassName
|
|
90
|
+
$processId = $window.Current.ProcessId
|
|
91
|
+
|
|
92
|
+
if (-not $All -and $name -notmatch $TitlePattern) {
|
|
93
|
+
continue
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
$texts = Get-DescendantText $window
|
|
97
|
+
$buttons = Get-DialogButtons $window
|
|
98
|
+
$closedBy = $null
|
|
99
|
+
|
|
100
|
+
if ($Mode -eq "close") {
|
|
101
|
+
$closedBy = Invoke-DialogButton $window $ButtonPattern
|
|
102
|
+
if (-not $closedBy) {
|
|
103
|
+
try {
|
|
104
|
+
$windowPattern = $window.GetCurrentPattern([System.Windows.Automation.WindowPattern]::Pattern)
|
|
105
|
+
$windowPattern.Close()
|
|
106
|
+
$closedBy = "WindowPattern.Close"
|
|
107
|
+
} catch {
|
|
108
|
+
$closedBy = $null
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
$dialogs += [pscustomobject]@{
|
|
114
|
+
title = $name
|
|
115
|
+
className = $className
|
|
116
|
+
processId = $processId
|
|
117
|
+
bounds = Convert-Rect $window.Current.BoundingRectangle
|
|
118
|
+
texts = $texts
|
|
119
|
+
buttons = $buttons
|
|
120
|
+
closedBy = $closedBy
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@{
|
|
125
|
+
ok = $true
|
|
126
|
+
mode = $Mode
|
|
127
|
+
count = $dialogs.Count
|
|
128
|
+
dialogs = @($dialogs)
|
|
129
|
+
} | ConvertTo-Json -Depth 8
|