Adobe 26001360 Scripting Guide - Page 23
Properties, and keywords of your scripting system. Variable names must be a single word
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 23 highlights
Adobe Illustrator CS Scripting Guide 23 newly created object. Storing references in variables is just the same as assigning any other value to the variable. set thisLayer to make new layer at beginning of document 1 or you can fill the variable with a reference to an existing object: set thisLayer to layer 1 of document 1 Visual Basic works similarly, however, there is an important distinction to note. If you are assigning an object reference to a variable you must use the Set command. For example, to assign a variable as you create a layer, use Set: Set thisLayer = Illustrator.Documents(1).Layers.Add or in reference to an existing layer, since it is also an object reference, use Set: Set thisLayer = Illustrator.Documents(1).Layers(1) If you are simply trying to assign a value to a variable in Visual Basic that is not an object reference, do not use set but simply use Visual Basic's assignment operator, the equals sign: thisNumber = 12 Try to use descriptive names for your variables-something like firstPage or corporateLogo, rather than x or c. While it will take a little more time to type the longer names, using them will make your scripts much easier to read. The length of a variable's name has no effect on the execution speed of your script, so use descriptive names. You can also give your variable names a standard prefix so that they'll stand out from the objects, commands, and keywords of your scripting system. Variable names must be a single word, but you can use internal capitalization (such as myFirstPage) or underscore characters (my_first_page) to create more readable names. Variable names cannot begin with a number, and they can't contain punctuation or quotation marks. Properties Both AppleScript and Visual Basic allow you to define properties for your scripts. Script properties are much like variables, but with additional features and requirements specific to each language. Since the meaning and usage of script properties differs so greatly between AppleScript and Visual Basic, please consult the bibliography for appropriate language references. 12 Aug 03