[Quark] Problem with OPI setting

I try to print a Quark document as PostScript, everything looks fine except the OPI option is not functioning. My script as follows (I have simplified the print setup):-

tell application "QuarkXPress Passport"
	activate
	tell document 1
		set theName to name
		tell print setup
			set separation to false
			set print spreads to false
			set registration marks to centered
			set tiling to off
			set page position to center position
			set print quality to normal
			set data format to binary data
		end tell
		tell OPI setup 1
			set OPI active to false
		end tell
		set thePSfile to ((path to desktop) & theName & ".ps") as string
		print PostScript file thePSfile
	end tell
end tell

After I distill the PostScript and check the PDF with Pitstop, but found that OPI tag still on for those images.
Need help urgently. Thanks!

Could it be that each picture box has an “OPI swap” property? (in addition to the OPI Setup for the whole document)

picture box‚n [see also QuarkXPress Suite] : A picture box
elements
contained by layers.
properties
OPI swap (boolean) : If TRUE, the specified image will be omitted from the PostScript stream

Maybe repeating thru every picture box and setting OPI swap to false will disable each OPI tag (shows up in Utilities → Usage → OPI tab):

tell application "QuarkXPress"
	tell document 1 to set allPictureBoxes to every picture box
	repeat with aPictureBox in allPictureBoxes
		set OPI swap of aPictureBox to false
	end repeat
end tell

Thank you, pandrake.
I tried it but still no luck …
I suspect it could be due to my Quark, I will try it again on the other mac.
Thanks again.

I noticed your script uses QuarkXPress Passport whereas I’m using just QuarkXPress (7.3) so, ya, that might be it.

Also, I am neither distilling or exporting to PDF, just manipulating the OPI settings in the Quark layout properties. I didn’t see any AppleScript hooks into anything in the PDF styles, which is probably where the OPI tags are getting into the postscript/PDF output. If manually setting the OPI active to false in a PDF export do the OPI tags still show up? Or, if distilling a postscript file (instead of using Export as PDF in Quark), when the print settings of OPI active to false are manually set does it still result in a PDF with OPI tags? If so, then there’s probably a problem with Quark. If not, then there’s just no way to automate disabling OPI tags with AppleScript.

Thanks for your reply, pandrake.
I finally found that the file that I used for testing my script is giving some problems. I tried with other files and got the results.
Thanks again!

Ooop! Indeed, I forgot that the layout file is also another possible vector for problems. Good to hear it’s neither Quark or AppleScript that’s broken.

Cheers! And thank you for getting into OPI tricks - I’ve yet to venture that way but expect to in the near future, so you’ve done a little reconnoitering for me. :wink: