QuarkXPress 6 Spread Finder
QuarkXPress 6 Spread Finder
- Subject: QuarkXPress 6 Spread Finder
- From: Jason Bourque <email@hidden>
- Date: Thu, 24 Jun 2004 11:53:17 -0400
Hello,
AppleScript version: 1.9.3, OS version: 10.3.4, QuarkXPress 6.1
I wrote this script to find what spreads in a document was a spread (has
graphics or text boxes that span both pages.) It is kinda slow. Any ideas on
making it faster? Download here. www.jasonsmark.com/SpreadChecker.sitx
Thanks, Jason Bourque
tell application "QuarkXPress"
-- activate
-- This line will ensure that a document is open, before proceeding
if not (exists document 1) then error "No document is open."
tell document vDocName to set vSpreadCount to count of spreads
set vLeft to 8
set vRight to 9.5
set vBoxBList to {}
set vBoxDList to {}
set vPagesList to {}
repeat with vNth from 1 to vSpreadCount
-- set item vNth of vPagesList
tell document vDocName
try
set vTextBoxes to every text box of spread vNth
on error
set vTextBoxes to {}
end try
try
set vGenericBoxes to every graphic box of spread vNth
on error
set vGenericBoxes to {}
end try
try
set vPictureBoxes to every picture box of spread vNth
on error
set vPictureBoxes to {}
end try
end tell
repeat with vNth2 from 1 to count of vTextBoxes
set vItemNth to item vNth2 of vTextBoxes
set vItemBounds to bounds of vItemNth as list
-- copy BoxB to end of vBoxBList
set BoxB to ((item 2 of vItemBounds) as inch units) as real --
Left
-- copy BoxD to end of vBoxDList
set BoxD to ((item 4 of vItemBounds) as inch units) as real --
Right
set vTest1 to (BoxB is less than vLeft)
set vTest2 to (BoxD is greater than vRight)
set vTest3 to (vNth is not in vPagesList)
if vTest1 and vTest2 and vTest3 then
copy vNth to end of vPagesList
exit repeat
end if
end repeat
if vNth is not in vPagesList then
repeat with vNth2 from 1 to count of vGenericBoxes
set vItemNth to item vNth2 of vGenericBoxes
set vItemBounds to bounds of vItemNth as list
-- copy BoxB to end of vBoxBList
set BoxB to ((item 2 of vItemBounds) as inch units) as real
-- Left
-- copy BoxD to end of vBoxDList
set BoxD to ((item 4 of vItemBounds) as inch units) as real
-- Right
set vTest1 to (BoxB is less than vLeft)
set vTest2 to (BoxD is greater than vRight)
set vTest3 to (vNth is not in vPagesList)
if vTest1 and vTest2 and vTest3 then
copy vNth to end of vPagesList
exit repeat
end if
end repeat
end if
if vNth is not in vPagesList then
repeat with vNth2 from 1 to count of vPictureBoxes
set vItemNth to item vNth2 of vPictureBoxes
set vItemBounds to bounds of vItemNth as list
-- copy BoxB to end of vBoxBList
set BoxB to ((item 2 of vItemBounds) as inch units) as real
-- Left
-- copy BoxD to end of vBoxDList
set BoxD to ((item 4 of vItemBounds) as inch units) as real
-- Right
set vTest1 to (BoxB is less than vLeft)
set vTest2 to (BoxD is greater than vRight)
set vTest3 to (vNth is not in vPagesList)
if vTest1 and vTest2 and vTest3 then
copy vNth to end of vPagesList
exit repeat
end if
end repeat
end if
end repeat
end tell
return vPagesList
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.