I was wondering if someone knows what could be wrong with this script. Application is Quark 4.11 operating in classic mode. Everything works (it takes a job number and sets a path via buttons then is SUPPOSED to save the Quark page as an EPS file in the given location.) The path seems to check out, however, I get the following error: “Cant make data into expected type”. I am having trouble understanding why. Here is the script… Thanks in advance.
set answerhold to display dialog "Enter Job Number (excluding leading zeros)" default answer ""
set filename to text returned of answerhold
if (count of result) is equal to 3 then
set finalnumber to (characters -1 thru 1 of ("0000000" & filename)) as text
else if (count of result) is equal to 4 then
set finalnumber to (characters -1 thru 1 of ("000000" & filename)) as text
else if (count of result) is equal to 5 then
set finalnumber to (characters -1 thru 1 of ("00000" & filename)) as text
else if (count of result) is equal to 6 then
set finalnumber to (characters -1 thru 1 of ("0000" & filename)) as text
else if (count of result) is equal to 7 then
set finalnumber to (characters -1 thru 1 of ("000" & filename)) as text
end if
tell application "QuarkXPressâ„¢ 4.11"
display dialog "Choose destination..." buttons {"C^", "R^", "S^"}
set theChoice to button returned of result
if theChoice is "C^" then
tell application "QuarkXPressâ„¢ 4.11"
set DestinationFolder to "HIGH RES ART:C:" as text
set NewDocPath to ((DestinationFolder as text) & theChoice & finalnumber) as string
end tell
else if theChoice is "R^" then
tell application "QuarkXPressâ„¢ 4.11"
set DestinationFolder to "HIGH RES ART:R:" as text
set NewDocPath to ((DestinationFolder as text) & theChoice & finalnumber) as string
end tell
else if theChoice is "S^" then
tell application "QuarkXPressâ„¢ 4.11"
set DestinationFolder to "HIGH RES ART:S:" as text
set NewDocPath to ((DestinationFolder as text) & theChoice & finalnumber) as string
end tell
end if
end tell
tell application "QuarkXPressâ„¢ 4.11"
activate
tell document 1
save in NewDocPath as file type EPS format Mac black and white EPS data binary EPS with OPI --this is the line that errors out.
end tell
end tell