Adobe 26001360 Scripting Guide - Page 444
Swatches, Example 79.1
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 444 highlights
444 Example 79.1 This script illustrates how to change the name of the fifth swatch. Dim appRef As New Illustrator.Application Dim swatch5 As Illustrator.Swatch Set swatch5 = appRef.ActiveDocument.Swatches(5) Visual Basic Reference Swatches A collection of swatches in a document. Table 5.147 Swatches - Properties Property Application Count Parent R/O Value type What it is R/O Application object The Illustrator Application object R/O Long The number of objects in the collection R/O Document object The document that contains this Swatches object Table 5.148 Swatches - Methods Method Add Index(item As Swatch) Item(itemKey) RemoveAll() Returns Swatch object Long Swatch object Nothing What it does Creates a new object Returns the index position of the object within the collection Returns an object reference to the object identified by itemKey; by name or index Deletes all objects in this collection Example 80.1 This script illustrates how to first obtain a Swatch by index and then how to delete that Swatch. Dim appRef As New Illustrator.Application Dim swatchToDelete As Illustrator.Swatch Dim documentSwatches As Illustrator.Swatches Set documentSwatches = appRef.ActiveDocument.Swatches Set swatchToDelete = documentSwatches("Orange") 12 Aug 03