Examples are shown in this article.
Note: Knowledge of InDesign scripting is required.
Smart Styles extends the Asset and Library object.
Additional asset method:
- Property: applySmartStyle
- Parameters: Selection or (list of) PageItem(s)
- Returns: nothing
- What it does: Applies the asset as Smart Styles to the page item(s).
// This example applies the first item of the first library as Smart // Style to the first page item of the active document var myLib = app.libraries.item(0).assets.item(0); var myItems = [app.activeDocument.pageItems.item(0)]; myLib.applySmartStyle( myItems );
Additional library property:
- Property: smartStyles
- Value type: Boolean
- Access: read/write
- What it is: Toggles the library between an Object and Smart Styles library.
// The script toggles the first library from Smart Styles to // Object library or the other way around if( app.libraries.item(0).smartStyles == false ) app.libraries.item(0).smartStyles = true; else app.libraries.item(0).smartStyles = false;