Re: QuarkXPress 6 Spread Finder
Re: QuarkXPress 6 Spread Finder
- Subject: Re: QuarkXPress 6 Spread Finder
- From: Hans Haesler <email@hidden>
- Date: Sat, 3 Jul 2004 23:18:14 +0200
On Thu, 24 Jun 2004, Jason Bourque wrote:
>
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?
Hello Jason,
sorry for the delay. I've been on vacation.
Your script will run much faster with the 'do script' method.
Then there are other modifications which will contribute
a little to make it faster.
- unselect an eventual selection
- don't build lists of each box type but address the 'generic boxes' directly
- set the bounds of the current box in the items of a list
- don't set the variables 'vTest1', 'vTest2', 'vTest3', but make
the test directly
- use 'set end of ...' (instead of 'copy vNth to end of ...')
---
tell application "QuarkXPress"
if not (exists document 1) then error "No document is open."
set selection to null
do script {checkSpreads}
end tell
script checkSpreads
tell document 1 of application "QuarkXPress"
set vLeft to 8
set vRight to 9.5
set vPagesList to {}
repeat with vNth from 1 to count of spreads
tell spread vNth
repeat with vNth2 from 1 to count of generic boxes
set {y1, x1, y2, x2} to bounds of generic box vNth2 as list
set BoxB to (x1 as inch units) as real -- Left
set BoxD to (x2 as inch units) as real -- Right
if (BoxB is less than vLeft) and (BoxD is greater than vRight) then
set end of vPagesList to vNth
exit repeat
end if
end repeat
end tell
end repeat
end tell
return vPagesList
end script
---
Hans Haesler <email@hidden>
_______________________________________________
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.