I am trying to have Quark place an image in a picture box. If it can not I have it run through a loop to add “.eps”, “.tif”, “.pdf” and try each of those.
Here’s my problem. If Quark does place it with “.eps” it still tries the others in the list and errors. I need it to stop if it is successful and to delete the picture box if it is not.
Here’s what I have so far:
set fileTypeList to (".eps", ".tif", ".pdf")
tell picture box 1
set k to 1
try
--set image 1 to (hiresFileNamePath & theFile) as alias
set image 1 to ("Macintosh HD:Desktop Folder:Magvol_1:Current:REP200407:Display Ad:Hi Res:" & theFile)
set bounds of image 1 to exact fit
set name to theFile
on error
set flag to false
repeat with f from 1 to count of items of fileTypeList
--set image 1 to (hiresFileNamePath & theFile & ftype) as alias
set ftype to item f of fileTypeList
set image 1 to ("Macintosh HD:Desktop Folder:Magvol_1:Current:REP200407:Display Ad:Hi Res:" & theFile & ftype)
set bounds of image 1 to exact fit
set name to theFile
if image 1 is true then
exit repeat
end if
end repeat
end try
-->REPLACE THIS WITH THE TELL PICT BOX DELETE
--end tell
end tell
I tried it with adding 1 to each loop but couldn’t figure out what to do with it?
Any ideas on what I am doing wrong would be great!
Thank you all,
Steven.