QuarkXpress: Check image type

I have searched BBS archvies as well as Shirley Hopkins AS QXP book.

Does anyone have a script to check image type in a QXP document? I need it to find RGB images (if any), locate them in the main art folder, open them in PhotoShop, convert them to CMYK, re-import them into the QXP doc and save. (Simple right?)

I know QXP can not update modified images. I know PhotoShop can “Do Script” which I can save as an action.

I have not started writing the script yet. I wanted first to see if anyone else has tackled this or if anyone can offer snippets on the different parts of code required (mainly the check image type in the doc).

AS1.6
OS9.2.2
QXP4.11

As always, thank you for any help and if figure it out first I’ll post my script.

Steven.

Hi,

I tried working with the properties of an image through Quark, but all that was returned for RGB and CMYK images were “image type:color 32 bit image”

I know it would be overkill to open every picture of your Quark doc in Photoshop, but that’s about all I can think of.

This was written for 10.3, Quark 6 and Photoshop CS2. I’m sure it could use some optimizing…


tell application "QuarkXPress"
	tell document 1
		set tool mode to drag mode
		set pgcount to count of pages
		repeat with i from 1 to pgcount
			tell page i
				set boxList to picture boxes as list
				repeat with theBox in boxList
					set filePath to file path of image 1 of theBox
					set offsetprop to offset of image 1 of theBox
					set scaleProps to scale of image 1 of theBox
					--return filePath
					if filePath is not null then
						set filePath to filePath as alias
						tell application "Adobe Photoshop CS2"
							open filePath
							try
								change mode of current document to CMYK
							end try
							close current document saving yes
						end tell
						set image 1 of theBox to filePath
						set scale of image 1 of theBox to scaleProps
						set offset of image 1 of theBox to offsetprop
					end if
				end repeat
			end tell
		end repeat
	end tell
end tell