Adobe 26001360 Scripting Guide - Page 289
Syntax differences between Sub and Function methods, Application, EPSSaveOptions
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 289 highlights
Adobe Illustrator CS Scripting Guide 289 There are a number of objects in addition to Application that cannot be obtained by using the hierarchy shown in the object model diagram. These objects must created directly using the techniques shown above for the Application object. Those objects include: ExportOptionsFlash Ink InkInfo NoColor OpenOptions PaperInfo PPDFile PPDFileInfo PrintColorManagementOptions PrintJobOptions PrintColorSeparationOptions PrintOptions PrintCoordinateOptions PrintPageMarksOptions Printer PrintPaperOptions PrinterInfo PrintPostScriptOptions PrintFlattenerOptions Screen PrintFontOptions ScreenSpotFunction The following example demonstrates how to create new objects such as EPSSaveOptions. ' Create a reference to the Illustrator Application Dim appRef As New Illustrator.Application ' Create an EPS-save option object Dim myEPSSaveOptions As New Illustrator.EPSSaveOptions ' Set the options according to how you want the save to occur myEPSSaveOptions.EmbedAllFonts = True myEPSSaveOptions.Compatibility = aiIllustrator8 myEPSSaveOptions.Preview = aiColorTIFF ' Save the active document appRef.ActiveDocument.SaveAs "C:\Temp\AI_TestDocument.eps", myEPSSaveOptions Syntax differences between Sub and Function methods Visual Basic supports different types of methods. When scripting Illustrator, your scripts will call both Sub and Function methods. The difference between the two methods is that a Function returns a value while a Sub, or method call, does not. For example, the Add method is a function because it returns a reference to the newly added object. When calling a Function, Visual Basic expects you to put parentheses around the function's arguments. With a Sub, however, Visual Basic disallows the use of parentheses around the 12 Aug 03