Skip to main content
Known Participant
October 7, 2009
Question

How to find out the type and colorants of the embedded images?

  • October 7, 2009
  • 1 reply
  • 931 views

Is it possible to find out the "Type" and "Colorants" of the Embedded images(which diplay in "Document Info" Embedded Images details) via scripting for illustrator cs3. Kindly help me.

Thanks

This topic has been closed for replies.

1 reply

Patrice Brel
Inspiring
October 10, 2009

Good evening,

To find the type it's possible (on Windows) to idenify the extension of the file

Sub colorants()
Set myAi = CreateObject("illustrator.application.CS4")
Set myDocAi = myAi.ActiveDocument
Set mylayer = myDocAi.Layers("graphlayer")
nbElements = mylayer.PageItems.Count
For i = 1 To nbElements
On Error Resume Next
MsgBox (mylayer.PageItems(i).File)
aa = mylayer.PageItems(i).colorants(0)
'2 = 0 1 2   R G B
'3 = 0 1 2 3 C M J K
MsgBox ("colorants " & aa(0) & " " & aa(1) & " " & aa(2))

MsgBox (mylayer.PageItems(i).ImageColorSpace)

Next

End Sub

Patrice

Known Participant
October 13, 2009

Thanks for your great help.