Adobe 26001360 Scripting Guide - Page 339
GraphicStyles, Example 24.1
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 339 highlights
Adobe Illustrator CS Scripting Guide 339 Example 24.1 This example duplicates and groups the current selection, applying the second graphic style in the document to the items in the group. Dim appRef As New Illustrator.Application Dim newGroup As Illustrator.GroupItem Dim dupItem As Object Dim artItem As Object Dim i As Integer Dim endIndex As Integer If appRef.Documents.Count > 0 Then If Not IsEmpty(appRef.ActiveDocument.selection) Then endIndex = UBound(appRef.ActiveDocument.selection) Set newGroup = appRef.ActiveDocument.GroupItems.Add For i = 0 To endIndex Set artItem = appRef.ActiveDocument.selection(i) Set dupItem = artItem.Duplicate(newGroup, aiPlaceAtEnd) appRef.ActiveDocument.GraphicStyles(2).ApplyTo dupItem Next End If End If GraphicStyles A collection of graphic styles in a document. Table 5.46 GraphicStyles - Properties Property R/O Value type What it is Application Count Parent R/O Application object The Illustrator Application object R/O Long The number of GraphicStyles in the document R/O Document object The document that contains this GraphicStyles object Table 5.47 GraphicStyles - Methods Method Returns Index(item As GraphicStyle) Long What it does Returns the index position of the object within the collection 12 Aug 03