Re: Selecting and deleting text in QuarkXPress
Re: Selecting and deleting text in QuarkXPress
- Subject: Re: Selecting and deleting text in QuarkXPress
- From: Shane Stanley <email@hidden>
- Date: Sat, 21 Jul 2001 17:13:06 +1000
On 20/7/01 8:26 PM +1000, Hans Haesler, email@hidden, wrote:
>
On Fri, 20 Jul 2001, David Lloyd wrote:
>
>
> I have two questions regarding text in QuarkXPress...
>
>
Well... they have been answered by Shane, already.
>
But I have a remark regarding the second solution.
>
>
Even the corrected version (theOffset + 2) will fail when the box has
>
two or more columns, because counting lines in a multiple-columns box
>
returns a wrong result.
You are right about my snippet, of course. But I think you can get the
correct line count -- or, more usefully, offset of the last character -- if
you ask nicely. Try this:
tell application "QuarkXPress 4.11"
tell document 1
tell text box 1
set theOffsets to offset of character -1 of every line
-- set lineCount to count items of theOffsets
delete text from character ((item -1 of theOffsets) + 2) to character -1
of story 1
if character -1 = return then delete character -1
end tell
end tell
end tell
--
Shane Stanley, email@hidden