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: Fri, 20 Jul 2001 18:48:30 +1000
On 20/7/01 6:13 PM +1000, David Lloyd, email@hidden, wrote:
>
I have two questions regarding text in QuarkXPress...
>
>
-----
>
>
I can select text in a text box in QuarkXPress like so...
>
>
"set selection to character 1 of text box 1"
>
"set selection to word 1 of text box 1"
>
"set selection to paragraph 1 of text box 1"
>
"set selection to text style range 1 of text box 1".
>
>
But I can't find any method of selecting a range, i.e...
>
>
"set selection to paragraphs 1 thru 3 of text box 1".
>
>
Can anyone suggest a way of selecting a range of text in QuarkXPress?
tell application "QuarkXPress 4.11"
tell document 1
set selection to text from paragraph 1 to paragraph 3 of story 1 of text
box 1
end tell
end tell
>
>
-----
>
>
Another problem: I want to delete all text in a box which is overflowed.
>
>
Again, I can...
>
>
tell text box 1
>
copy offset of character -1 of line -1 to theOffset
>
set text of characters (theOffset + 1) thru -1 to ""
>
end
>
>
...and modified to this makes it faster...
>
>
tell text box 1
>
copy offset of character -1 of line -1 to theOffset
>
copy characters 1 thru theOffset of text 1 as string to theText
>
copy (count of paragraphs in theText) to numParas
>
set text of paragraphs (numParas + 1) thru -1 to ""
>
set text of characters (theOffset + 1) thru -1 to ""
>
end
>
>
...but surely there's another easier (and faster) way?
tell application "QuarkXPress 4.11"
tell document 1
tell text box 1
set theOffset to offset of character -1 of line -1
delete text from character theOffset to character -1 of story 1
end tell
end tell
end tell
--
Shane Stanley, email@hidden