Scripting Illustrator CS6 printing

I found some syntax like the following in old posts from 2006, but I get errors with it in CS6 Illustrator. Would there be a new syntax to get this to work?

tell application "Adobe Illustrator"
	set theseDocs to the name of every document
	
	repeat with n from 1 to count of theseDocs
		set ThisDoc to item n of theseDocs
		set marks_options to {class:page marks options, color bars:false, page info marks:true, registration marks:false, trim marks:true}
		set print_options to {class:print options, page marks options:marks_options}
		
		print ThisDoc options print_options
	end repeat
	
	
end tell

I know people are squeezed for time and budget, but it would be great if AppleScript dictionaries had true examples of the correct syntax to call out their function definitions. :confused:

Thanks for any help!

Model: iMac 2009 3.33 GHz Intel Core 2 Duo, 16 GB RAM
AppleScript: 2.2.3
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)

Adobe publishes an Applescript scripting guide for every version of their apps, which you can find online (for free) and which features several examples. I don’t have CS6, but I glanced at that code and saw a potential issue. theseDocs is a namestring list, and the print command is directed to a name, not a document reference. The fix may be as simple as changing the print line to read

       print document ThisDoc options print_options

Unfortunately, when I place that (as well as the previous line) it just errors saying it can’t get the document.

According to the dictionary, that should be:

set print_options to {class:print options, page marks settings:marks_options}

Thanks, Shane, this worked beautifully.

Strange thing though. To set the print marks options you use the word “options,” but when you call them in the print options set you use the word “settings.”
Not consistent terminology there.

:wink:

I don’t know what you mean by “print mark options”.

The terminology looks pretty consistent to me: the objects are named … settings, and the properties that return them are named … options. They can’t be named the same of you’d have a terminology conflict, and nothing would work.