Re: QuarkXpress: Gettings words
Re: QuarkXpress: Gettings words
- Subject: Re: QuarkXpress: Gettings words
- From: Shane Stanley <email@hidden>
- Date: Thu, 12 Jul 2001 08:26:37 +1000
On 12/7/01 3:19 AM +1000, ThK, email@hidden, wrote:
>
Problem:
>
>
Quark returns "earth" when it is asked for "word x of line y of text box z of
>
document d" and it was "earth." because it was the end of a sentence.
>
>
But i need "earth." when it is "earth." and "earth" when it is "earth"!
>
>
The background ist, that my script has to recognize prices, measurements and
>
sizes that have to be converted into another language and format replacing the
>
original word or words.
>
>
Does anyone have an idea how to force this?`
I assume you're using version 4.11. The key is to use QXP's delimit table
item. This is a table of values for every character that essentially defines
how words are defined when scripting XPress. So you redefine the full point
as a word member, like this:
tell application "QuarkXPress 4.11"
set oldPoint to delimit item "." of delimit table 1
set delimit item "." of delimit table 1 to can be contained in word
tell story 1 of current box
set x to word 1
end tell
set delimit item "." of delimit table 1 to oldPoint
end tell
display dialog x
Note that:
(a) This doesn't change anything in the UI; and
(b) It remains in force until you either change it or quit XPress, so you
want to use it with care and lots of error trapping.
It's a very useful class that was inexplicably dropped after version 3.32,
but thankfully reappeared with 4.1.
--
Shane Stanley, email@hidden