Please see the code below I am not able to get Image name, where I am making mistake.
tell application "QuarkXPress"
tell document 1
set x to properties of generic box 1
set y to properties of image 1 of generic box 1
set ImageList to object reference of every generic box whose class is picture box
repeat with Mymage in ImageList
tell MyImage
set file_name to get name of image 1 as text
display dialog file_name
end tell
end repeat
end tell
end tell
I don’t have quark at home, but it looks like what you have should work. One thought is that the first box that you are trying to process does not have an image in it. You need to make sure that the file path of image 1 of Myimage is not null before going any further. I the file path is null then the name will be blank, or it might error out on you.
I don’t have Quark available but if someone who does can run this script and post the results that are returned for the properties I might be able to figure out what is happening:
tell application "QuarkXPress"
tell document 1
set y to properties of image 1 of generic box 1
end tell
end tell
Do this in a new document that has one page and only one picture box created that has a picture linked to it.
ok I can tell one of two things is going on either name of image broke with 6.52 or it broke with intel
You can get file path of image 1 of the box then extract the name form that though
tell application “QuarkXPress”
tell document 1
set theBoxes to every picture box
repeat with abox in theBoxes
try
set thepath to file path of image 1 of abox as string
set tid to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to “:”
set theName to text item -1 of thepath
set AppleScript’s text item delimiters to tid
if theName is not “null” then display dialog theName
end try
end repeat
end tell
end tell
mcgrailm is right, the name property is not assigned the file name so you will need to get it another way like he suggested or the this:
tell application "QuarkXPress"
tell document 1
set ImageList to object reference of every generic box whose class is picture box
repeat with Mymage in ImageList
tell MyImage
tell application "Finder" to set file_name to name of thepath
display dialog file_name
end tell
end repeat
end tell
end tell