Adobe 26001360 - Illustrator CS - PC Manual page 51

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

Advertisement

Adobe Illustrator CS Scripting Guide
In Visual Basic:
'Selection sorter
Private Sub Command1_Click()
Dim appRef As New Illustrator.Application
Dim documentRef As Illustrator.Document
Set documentRef = appRef.ActiveDocument
selectedObjects = documentRef.Selection
If TypeName(selectedObjects) = "String" Then
'text is selected
Else
'Is anything selected?
If selectedObjects = Empty Then GoTo noSelection
For Each artObject In selectedObjects
selectedObjectClass = TypeName(artObject)
Select Case selectedObjectClass
'Something is selected, let's find out what it is.
Case "PathItem"
'Object is a path item
Case "CompoundPathItem"
'Object is a compound path
Case "RasterItem"
'Object is a raster image
Case "PlacedItem"
'Object is a placed image
Case "MeshItem"
'Object is a mesh
Case "TextFrameItem"
'Object is a text frame item
Case "PluginItem"
'Object is a plugin art item
Case "PathPoint"
'Object is a point of a path
Case "GroupItem"
'Object is a group of objects
End Select
Next
End If
Exit Sub
noSelection:
MsgBox "Select an object and try again."
End Sub
12 Aug 03
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents