Move Global Assets Colors and Gradients to Document Asset Colors and Graidents
✓ Published0🌍 Public
KKevinGutowski
Last edited Jul 20, 2020
Created on Jul 20, 2020
This example shows how to move color and gradient assets from the global library into a document's asset collection. The code first retrieves the shared global assets using `MSPersistentAssetCollection.sharedGlobalAssets()`, then calls `colorAssets()` and `gradientAssets()` to extract those specific asset types. It then accesses the current document through `context.document` and uses its `documentData().assets()` object to set these collections with `setColorAssets()` and `setGradientAssets()`. The script relies on the Adobe InDesign scripting API, which provides access to document-level asset management.
AI-generated description