Adobe 26001360 - Illustrator CS - PC Manual page 371

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

Adobe Illustrator CS Scripting Guide
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
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
As Illustrator.meshItem
12 Aug 03
371

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents