Skip to main content
Glama

mcp-after-effects

by Dakkshin
getProjectInfo.jsx2.24 kB
// getProjectInfo.jsx // Get information about the current After Effects project function getProjectInfo() { var project = app.project; var result = { projectName: project.file ? project.file.name : "Untitled Project", path: project.file ? project.file.fsName : "", numItems: project.numItems, bitsPerChannel: project.bitsPerChannel, frameRate: project.frameRate, dimensions: project.displaySize, duration: project.duration, timeMode: project.timeDisplayType === TimeDisplayType.FRAMES ? "Frames" : "Timecode", items: [] }; // Count item types var countByType = { compositions: 0, footage: 0, folders: 0, solids: 0 }; // Get item information for (var i = 1; i <= project.numItems; i++) { var item = project.item(i); var itemType = ""; if (item instanceof CompItem) { itemType = "Composition"; countByType.compositions++; } else if (item instanceof FolderItem) { itemType = "Folder"; countByType.folders++; } else if (item instanceof FootageItem) { if (item.mainSource instanceof SolidSource) { itemType = "Solid"; countByType.solids++; } else { itemType = "Footage"; countByType.footage++; } } result.items.push({ id: item.id, name: item.name, type: itemType }); } result.itemCounts = countByType; return JSON.stringify(result, null, 2); } // Read arguments from the file (passed by the Node.js script) var argsFile = new File($.fileName.replace(/[^\\\/]*$/, '') + "../temp/args.json"); var args = {}; if (argsFile.exists) { argsFile.open("r"); var content = argsFile.read(); argsFile.close(); if (content) { try { args = JSON.parse(content); } catch (e) { // Handle parsing error } } } // Run the function and write the result var result = getProjectInfo(); // Write the result so it can be captured by the Node.js process $.write(result);

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dakkshin/after-effects-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server