G’day
The following script works OK when used as a script, but when used as an Application, it crashes. The error occurs in the ‘set T to T as real’ line, and generates an error ‘Can’t make <> into type real’.
Any advice please?
Regards
Santa
on QuarkMake_CropMarks(ThisBox)
tell application "QuarkXPress"
tell document DocName
tell current page
try
say "cropmarks"
copy (coerce (bounds of ThisBox as points rectangle) to list) to {T, L, B, R}
say "cropmarks 2"
set T to T as real
set L to L as real
set B to B as real
set R to R as real
set L1 to L - CropMarks_Offset - CropMarks_Length
set L2 to L - CropMarks_Offset
set R1 to R + CropMarks_Offset
set R2 to R + CropMarks_Offset + CropMarks_Length
set T1 to T - CropMarks_Offset - CropMarks_Length
set T2 to T - CropMarks_Offset
set B1 to B + CropMarks_Offset
set B2 to B + CropMarks_Offset + CropMarks_Length
say "cropmarks 3"
set Crop1 to make new line box at end with properties {start point:{T, L1}, end point:{T, L2}, width:CropMarks_Thickness}
set Crop2 to make new line box at end with properties {start point:{T, R1}, end point:{T, R2}, width:CropMarks_Thickness}
set Crop3 to make new line box at end with properties {start point:{B, L1}, end point:{B, L2}, width:CropMarks_Thickness}
set Crop4 to make new line box at end with properties {start point:{B, R1}, end point:{B, R2}, width:CropMarks_Thickness}
set Crop5 to make new line box at end with properties {start point:{T1, L}, end point:{T2, L}, width:CropMarks_Thickness}
set Crop6 to make new line box at end with properties {start point:{B1, L}, end point:{B2, L}, width:CropMarks_Thickness}
set Crop7 to make new line box at end with properties {start point:{T1, R}, end point:{T2, R}, width:CropMarks_Thickness}
set Crop8 to make new line box at end with properties {start point:{B1, R}, end point:{B2, R}, width:CropMarks_Thickness}
on error theerror number errNum
say "error in cropmarks"
display dialog theerror
set Crop1 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop2 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop3 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop4 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop5 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop6 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop7 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
set Crop8 to make new line box at end with properties {start point:{0, 0}, end point:{0, 0}, width:CropMarks_Thickness}
end try
end tell
end tell
end tell
return {Crop1, Crop2, Crop3, Crop4, Crop5, Crop6, Crop7, Crop8}
end QuarkMake_CropMarks