When running AppleScript in Quark 6 using the following line of code:
set filevar to file path of image i of it as text
Under Event Log, this show up:
get file path of image 10 of page 1 of document 1
Then I get the following error message:
“Can’t make <> of <> 10 of <> 1 of document 1 of application “Quark Express” into a string”
Can anyone please help on this question? Your comments would be greatly appreciated.
This is from an AppleScript originally written by Shirley Hopkins from her book “AppleScripting Quark Xpress”, but slightly modified by me. It worked great in Quark 4.11, (the application code line in the AppleScript below was slightly different), and we used it a lot, but we are currently switching to Quark 6.
The script places a list of pictures, and the pages they came from, into a new Quark document.
–Herbert Ripka
Greendale, WI
P.S. Does anyone know how to contact Shirley Hopkins?
P.P.S. The following is the complete script (which has the above problem in it):
set piclist to “”
set ThePath to “”
tell application “QuarkXPress”
tell default document 1
set properties to {facing pages:false, item spread coords:false}
set properties to {horizontal measure:points, vertical measure:points}
end tell
tell document 1
repeat with p from 1 to (count of pages)
tell page p
repeat with i from 1 to (count of picture boxes in it)
if not (bounds of image 1 of picture box i) = {0, 0, 0, 0} then
set m to the name
set filevar to file path of image i of it as text
set filename to my getfileName(filevar)
set thisline to "Page " & (m as text) & “:” & filename & return
set piclist to piclist & thisline
end if
end repeat
end tell
end repeat
end tell
make document at beginning with properties {page width:(8.5 * 72), page height:(11 * 72), page rule origin:{0, 0}, top margin:36, left margin:36, right margin:36, bottom margin:36}
tell document 1
make text box at beginning with properties {bounds:{36, 36, 730, 574}}
copy piclist to story 1
set properties of story 1 to {font:“Times”, size:10, leading:12, justification:“left”}
end tell
end tell
on getfileName(path)
set pathstr to (path as string)
set lastColon to (offset of “:” in (reverse of (characters of pathstr)) as string) of pathstr
return text from -(lastColon - 1) to -1 of pathstr
end getfileName