Adobe 26001360 Scripting Guide - Page 371
Notes, Example 38.1, MeshItems
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 371 highlights
Adobe Illustrator CS Scripting Guide 371 Notes MeshItems cannot be created from a script, but can be copied and pasted. Example 38.1 The following script illustrates how to copy MeshItems from one document to another. To run this script you need to have two open documents. One document should contain at least one MeshItem, the other document can be empty. Make the empty document the frontmost before running the script. Dim appRef As New Illustrator.Application Dim sourceDocument As Illustrator.Document Dim targetDocument As Illustrator.Document Dim meshItem As Illustrator.meshItem Dim newMeshItem As Illustrator.meshItem Dim targetSelection As Variant Dim locationOffset As Single Set targetDocument = appRef.Documents(1) Set sourceDocument = appRef.Documents(2) locationOffset = 0 For Each meshItem In sourceDocument.MeshItems sourceDocument.Activate meshItem.Copy targetDocument.Activate targetDocument.Paste 'Get a reference to the item that was just copied into the document targetSelection = appRef.selection If (IsEmpty(targetSelection)) Then MsgBox "Copy/Paste failed" Exit For End If Set newMeshItem = targetSelection(0) newMeshItem.Position = Array(100, 40 + locationOffset) locationOffset = locationOffset + 50 12 Aug 03