FW: QXP and Anchored Text Boxes
FW: QXP and Anchored Text Boxes
- Subject: FW: QXP and Anchored Text Boxes
- From: "Grimm, Kenneth" <email@hidden>
- Date: Tue, 16 Sep 2003 09:56:00 -0400
>
To all QXP gurus (or any other help, I ain't picky):
>
OS 9.2.2, QXP 4.11, AS 1.8.3, Script Debugger 3.0.5
>
I'm developing this script to search through a text flow of paragraphs
>
which are car ads, and if it finds a stock number, adds an anchored
>
picture box above the paragraph which has a picture of the car for sale.
>
>
It successfully finds the first (and sometimes the second) stock number,
>
inserts its anchored picture box -- and then will not find any more. No
>
errors reported. It just completes the script and never finds any other
>
stock numbers even though I can find them easily using QXP's "Find"
>
command.
>
In order for the script to work on the text again, I have to revert to the
last saved version of the text -- I can't just manually delete the anchored
picture box from the script's run -- if I do, the script never finds any
stock number when run again, or reports an error that the selection has
links that can't be duplicated (like it is somehow trying to paste the
entire block of text back into itself).
>
Can you see something I'm missing?
>
>
Thanks,
>
>
Ken Grimm
>
Prepress Manager
>
San Angelo Standard-Times
>
email@hidden
>
325-659-8357
>
>
>
tell application "QuarkXPress(tm) 4.11"
>
tell document 1
>
repeat with stkNumbersToCheck in {"256875", "184351", "218205"}
>
set myStockNumber to stkNumbersToCheck as string
>
repeat with i from 1 to count of paragraphs
>
if paragraph i of story 1 contains myStockNumber then
>
make picture box at beginning with properties
>
{name:myStockNumber, bounds:{"0.0\"", "0.0\"", "0.5\"", "1.0\""}}
>
set tool mode to drag mode
>
select picture box myStockNumber
>
cut
>
set tool mode to contents mode
>
set selection to insertion point before character 1 of
>
paragraph i of story 1
>
paste
>
end if
>
end repeat
>
end repeat
>
end tell
>
end tell
_______________________________________________
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.