(*

Set Scale of every Picture in every Picture Box to 100%

Here's a script which still needs some work, but it might be of interest to some. In a Quark (4.1.1 in this case) document, it starts at page 2 and looks at every picture box on each page. For any picture box which has a picture in it, the script gets the percentage scaling, coerces it from the Quark value (in percent) to a normal percentage, then opens the image in Photoshop, applies the percentage which was applied in the Quark box (without resampling), saves the image, the sets the Quark percentage to 100 percent.

Then you have to update all of the pictures in the Quark document, and everything will look like it did, but everything will be at 100%, which I've been told is the best for printing. Updating them all can be a pain if you have to answer "OK" to update many images, so one way around that is to go to Preferences > Document and set Auto Picture Import to "On" without verify. Then Save and close the document. When you open it again, it will automatically update all of the Picture boxes (this may take a while, and Quark may not respond while it's doing it, so give it a while).

Note that you need to have the Photoshop Scripting plug-in installed (Photoshop 7.0 Scripting plug-in v.1.0.2a as of this writing).

Update: it looks like this script doesn't work in PhotoShop CS (version 8) because PhotoShop CS expects percentage values as the quark value divided by 100, so here's another version of the set scale of every quarkxpress picture to 100% using PhotoShop applescript i made, it works in PhotoShopCS, and it also acts on images only one time because i had a document which had the same images in more than one place and didn't want them to be resized multiple times.


*)

tell front document of application "QuarkXPress™ 4.11"
	activate

	set numPages to count of pages
	
	repeat with i from 2 to numPages
		set boxCount to count of picture boxes of page i
		--	display dialog boxCount
		repeat with bx from 1 to boxCount
			set bxContent to (file path of images of picture box bx of page i)
			if bxContent ≠ null then
				--display dialog bxContent
				set bxScale to (scale of image 1 of picture box bx of page i) as list
				set bxPercent to (coerce item 1 of bxScale to real)
				--	display dialog bxPercent
				if bxPercent ≠ 100 then
					tell application "Adobe Photoshop 7.0"
						open file (bxContent as string)
						set docRef to current document
						resize image docRef width bxPercent as percent resample method none
						close docRef with saving
					end tell
					set scale of image 1 of picture box bx of page i to {"100", "100"}
				end if
			end if
		end repeat
	end repeat
end tell

beep
delay 1
beep



-- applescript page