Quark - import images to new boxes and size boxes to fit image

No error checking, so I don’t know what will happen if you have non image files in the folder with it, but if you need a large number of images imported into Quark quickly, this is a fast and dirty way to do it. Tested on Quark 6.52


tell application "Finder"
	set fileList to every file of folder (choose folder with prompt "Choose a folder")
end tell

repeat with i in fileList
	set j to i as text
	tell application "QuarkXPress"
		tell document 1
			make new picture box at beginning
			set image 1 of picture box 1 to alias j
			tell picture box 1
				tell image 1
					set bounds to box fit
				end tell
			end tell
		end tell
	end tell
end repeat