Adobe 26001360 Scripting Guide - Page 96
Example 8.1, application's default properties.
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 96 highlights
96 AppleScript Reference Example 8.1 The following example shows how to make sure a document is open before setting any of the application's default properties. -- Check to make sure a document is open in Illustrator -- before setting the application's default stroke width to 8 points tell application "Illustrator CS" if not (document 1 exists) then make new document with properties {color space: CMYK, width: 100.0, height: 50.0} end if set the default stroke width of document 1 to 8.0 end tell Example 8.2 The following example shows how to make new documents with custom defaults. -- Present a dialog to the user to choose a new document type -- from, then create a new document with its properties set accordingly -- Note: You can only change writable document defaults when a document is open -- Prompt user for new document properties from list of choices set listChoice to (choose from list ¬ {"CMYK, filled, 2 pt stroke with dashes", ¬ "RGB, filled, no stroke", ¬ "RGB, no fill, 1 pt stroke"} ¬ with prompt "What kind of new document to create?") if listChoice is not false then -- Gather the values needed to set the document's properties set documentType to item 1 of listChoice set fillPaths to (documentType contains "filled") set strokePaths to (documentType contains "pt stroke") set strokeWidth to 0.0 if documentType contains "1 pt" then set strokeWidth to 1.0 else if documentType contains "2 pt" then set strokeWidth to 2.0 end if if documentType contains "with dashes" then 12 Aug 03