Here is the script I have - it came from the Quark forums - to update images on a page.
tell application “QuarkXPress™ 4.11”
if exists document 1 then tell document 1
set CountOfPicts to count of picture boxes
if CountOfPicts < 1 then return
repeat with PictBoxToCheck from 1 to CountOfPicts
set ImageFilePath to file path of image 1 of picture box PictBoxToCheck
if ImageFilePath is not null then
try
get (properties of image 1 of picture box PictBoxToCheck)
set MyProp to result
if not (missing of MyProp) then
if modified of MyProp then
set image 1 of picture box PictBoxToCheck to ImageFilePath – reimport the image
–restore scale, offset, etc. of old image to new image
set angle of image 1 of picture box PictBoxToCheck to angle of MyProp
set color of image 1 of picture box PictBoxToCheck to color of MyProp
set contrast of image 1 of picture box PictBoxToCheck to contrast of MyProp
set image trap of image 1 of picture box PictBoxToCheck to image trap of MyProp
set invert runaround of image 1 of picture box PictBoxToCheck to invert runaround of MyProp
set negative of image 1 of picture box PictBoxToCheck to negative of MyProp
set offset of image 1 of picture box PictBoxToCheck to offset of MyProp
set scale of image 1 of picture box PictBoxToCheck to scale of MyProp
set screen of image 1 of picture box PictBoxToCheck to screen of MyProp
set screen angle of image 1 of picture box PictBoxToCheck to screen angle of MyProp
set screen frequency of image 1 of picture box PictBoxToCheck to screen frequency of MyProp
set screen function of image 1 of picture box PictBoxToCheck to screen function of MyProp
set shade of image 1 of picture box PictBoxToCheck to shade of MyProp
set show half tone of image 1 of picture box PictBoxToCheck to show half tone of MyProp
set skew of image 1 of picture box PictBoxToCheck to skew of MyProp
set suppress printing of image 1 of picture box PictBoxToCheck to suppress printing of MyProp
end if
else
set x to ImageFilePath as string
set OD to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to “:”
set y to last text item of x
set AppleScript’s text item delimiters to OD
display dialog “Image “” & y & “” is missing.” buttons “OK” default button 1 with icon 2
end if
on error errmsg number errnum
display dialog errmsg & return & “(” & errnum & “)” buttons “OK” default button 1 with icon stop
end try
end if
end repeat
end tell
end tell
In the 10th line of the script - the one which says “set MyProp to result” it errors on every picture box on the page. I have isolated the error to this line. I just can’t figure out why it is wrong. The error I get is “Can’t make some data into the expected type. (-1700)” Any help will be MOST appreciated.
Thank you.
Jmax