Hi all,
I have a script that will batch print qxp files dropped onto this app and add a 1st APPROVAL stamp outside the print area.
This has undergone several versions and has been working fine on more than 1 mac.
Now when I have added the part that sets pWidth to the width of the current document to enable the 1st APPROVAL text box to be positioned in relation to the page size, the script no longer works on another mac. It does work fine on my mac!
The error I get is “Can’t make <> into type integer”
Any reason for this??
PS. if I change the “as integer” part to “as real” the error message changes to reflect this change!!
the code:-
on open these_items
repeat with i from 1 to the count of these_items
set this_item to (item i of these_items)
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else if (alias of the item_info is false) then
my process_item(this_item)
end if
end repeat
end open
on process_folder(this_folder)
set these_items to list folder this_folder without invisibles
repeat with i from 1 to the count of these_items
set this_item to alias ((this_folder as text) & (item i of these_items))
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else if (alias of the item_info is false) then
my process_item(this_item)
end if
end repeat
end process_folder
on process_item(this_item)
tell application "Finder"
try
set File_Name to name of file this_item as text
on error
display dialog "Bad"
end try
end tell
--Force Default printer to Bahamas
tell application "Printer Setup Utility"
set current printer to first printer whose name is "Bahamas"
end tell
tell application "QuarkXPress"
open this_item use doc prefs «constant KPRFyes »
--Check for missing or modified images and warn!
try
tell document 1 to set modPics to count of (every picture box whose modified of image 1 is true)
if modPics > 0 then tell every page of layout space 1 of project 1
make new text box at beginning with properties {bounds:{"147.847 mm", "28 mm", "198.533 mm", "197.631 mm"}, runaround:none runaround, vertical justification:top justified, rotation:"15°"}
set story 1 of text box 1 to "MISSING OR MODIFIED IMAGES FOUND"
set size of story 1 of text box 1 to 26
set font of story 1 of text box 1 to "321impact"
set shade of story 1 of text box 1 to "100%"
end tell
end try
set pWidth to page width of document 1 as integer
set pHeight to page height of document 1 as integer
set page rule origin of document 1 to {"0mm", "0mm"}
tell every page of layout space 1 of project 1
make new text box at beginning with properties {bounds:{pHeight - 3, pWidth / 2 - 30, pHeight + 31, pWidth / 2 + 50}, runaround:none runaround, vertical justification:bottom justified, opacity:"70%"}
set story 1 of text box 1 to "1st APPROVAL"
set size of story 1 of text box 1 to 30
set font of story 1 of text box 1 to "HelveticaNeue BoldCond"
set shade of story 1 of text box 1 to "70%"
end tell
--print it
with timeout of 5 * minutes seconds
tell document 1
tell print setup
set printer type to "Xerox WorkCentre Pro 255"
set paper size to "A3"
set orientation to portrait
set page position to center position
set print spreads to false
set fit in area to false
set reduce or enlarge to 100
set registration marks to centered
end tell
tell custom bleeds setup 1
set bleed type to asymmetric
set bleed to {"3mm", "3mm", "150mm", "3mm"}
set bleed clipping to true
end tell
end tell
print document 1 copies 1
close document 1 saving no
end timeout
end tell
end process_item
Thanks in advance