Re: Selecting and deleting text in QuarkXPress
Re: Selecting and deleting text in QuarkXPress
- Subject: Re: Selecting and deleting text in QuarkXPress
- From: David Lloyd <email@hidden>
- Date: Sat, 21 Jul 2001 12:53:36 +1000
Hans Haesler:
>
Here is my workaround:
>
---
>
tell document 1 of application "QuarkXPress 4.11"
>
activate
>
make text box at beginning with properties {bounds:{20, 20, 60, 60}}
>
set next text box of text box 2 to text box 1
>
delete text 1 of text box 1
>
delete text box 1
>
set lastChar to character -1 of text 1 of text box 1
>
if (ASCII number of lastChar) is less than 33 then
>
delete character -1 of text 1 of text box 1
>
end if
>
end tell
Good Hans, however...
It didn't work - not initially anyway...
but modifying this line did:
make text box at beginning with properties
{bounds:{20, 20, 60, 60}, runaround:none runaround}
It appears that your script was assuming that text box runarounds were
turned off by default, or your new text box would not land upon the existing
one...
This alteration made the script work correctly, thus:
tell document 1 of application "QuarkXPress 4.11"
activate
copy bounds of text box 1 to theBounds
make text box at beginning with properties
{bounds:theBounds, runaround:none runaround}
set next text box of text box 2 to text box 1
delete text 1 of text box 1
delete text box 1
set lastChar to character -1 of text 1 of text box 1
if (ASCII number of lastChar) is less than 33 then
delete character -1 of text 1 of text box 1
end if
end tell
(I only created the new text box on top of the existing one because it
looked more "elegant" :)
David Lloyd
---------------------------------
email: email@hidden
web:
http://www.kanzu.com
---------------------------------