
.js scripts. Files are safely stored in your system's native user data folder and displayed with name, description, size, and last-modified time. Rename local files directly from the actions menu.Cmd/Ctrl+S to save). New scripts get a pre-filled metadata header template..js file and the app automatically reads its header comment to pre-fill the script's name and description..js files onto the sidebar drop zone to add them to your local library instantly.Adding a script from disk: Click Add Script in the sidebar (or drag .js files onto the drop zone). The app reads the file's metadata header and saves it to your local library.
Installing a script into Affinity: In My Scripts, click the grey dot on the left of any row (or click anywhere on the row). The dot turns green when the script is live in Affinity.
Editing a script: Click the pencil icon in the Actions column, or open the Code Editor tab and pick a script from the list. Save with Cmd+S (Mac) or Ctrl+S (Windows). If the script is already installed in Affinity, Watch Mode will push the update automatically.
Writing a new script: Go to Code Editor and click New Script. A blank buffer opens with a pre-filled metadata header. Give it a name, write your code, then save.
Community scripts: Open the Community tab. Browse, filter, or search for scripts. Click Install to save to your library and push to Affinity simultaneously. Click the save icon instead to download to your library only, for review before installing.
Forking a community script: Go to Code Editor → Community — Fork & Edit and click Fork & Edit on any script. It is saved to your local library and opened in the editor.
Downloading from Affinity: Open Installed Scripts and click Download on any script to save it back to your local library.
Reading the docs: Click Documentation in the sidebar. The app fetches all available SDK topics from the MCP server and renders them as Markdown.
Searching the SDK: Use the search bar in the Documentation screen to query SDK hints directly.
To make your scripts compatible with the Affinity Script Manager, include a metadata block at the very beginning of your .js file. When a user imports your script, the app automatically parses this header and fills in the title and description.
Use a standard JavaScript block comment (/** ... */) at the very top of your file:
/**
* name: Auto Exporter
* description: Automatically exports all selected layers as PNG files.
* version: 1.0.0
* author: Your Name
*/
// --- Your code starts here ---
function exportLayers() {
// ...
}
| Tag | Required | Description |
|---|---|---|
name |
✅ | The title of your script as it appears in the library. |
description |
Recommended | A short 1–2 sentence explanation of what the script does. |
version |
Optional | Current version, e.g. 1.0.0. Used for update detection. |
author |
Optional | Your name or GitHub handle. |
/** must be on the first line of the file (blank lines before it are fine; no code before it).name:, not Name:).The Affinity Script Manager is completely decentralized. You can add any creator's GitHub repository to access their scripts alongside the default ones.
https://github.com/username/repository-name).The app converts the URL to a raw registry.json link automatically and fetches the scripts immediately.
.js scripts.registry.json in the root of the repository on the main branch.{
"scripts": [
{
"id": "my-awesome-script",
"name": "My Awesome Script",
"description": "Does something amazing with layers.",
"version": "1.0.0",
"author": "Your Name",
"contributors": ["Contributor One", "Contributor Two"],
"category": "Layers",
"image": "previews/my-awesome-script.webp",
"download_url": "https://raw.githubusercontent.com/username/repo/main/my-script.js"
}
]
}
Make sure
download_urlpoints to the raw version of your.jsfile. The optionalimagecan be a full URL or a path relative toregistry.json; previews are shown in a fixed 16:9 frame.
Once your registry.json is in place, anyone can paste your GitHub link into the app and install your scripts with a single click.
If a script does not appear in Affinity after clicking Install, check the following:
Make sure MCP is enabled in Affinity.
Affinity Script Manager communicates with Affinity through the local MCP bridge. If MCP is disabled or does not have the required permissions, the app cannot push scripts into Affinity.
Allow MCP to save scripts/workflows to the Scripts panel.
In Affinity settings, check the MCP/AI assistant permissions and make sure the bridge is allowed to save scripts to Affinity.
Open the Scripts panel in Affinity.
Go to Window → General → Scripts.
Create at least one category in the Scripts panel.
Affinity needs a category in the Scripts panel before scripts can be installed there.
In the Scripts panel, use Create New Category and create any category, for example My Scripts.
Try installing again.
Return to Affinity Script Manager and click the install dot next to your script again. The script should now appear in Affinity's Scripts panel.
.dmg file..dmg, then drag Affinity Script Manager into your Applications folder.The app is now approved and will open normally from this point on.
Note: This prompt only appears because the app is not notarized with an Apple Developer certificate. The source code is fully open — you can inspect it in this repository before running it.
This project is not affiliated with Affinity or Canva. Affinity is a trademark of Canva.
$ claude mcp add Affinity-script-manager \
-- python -m otcore.mcp_server <graph>