RE: Quark-experts, HELLLLPPP
RE: Quark-experts, HELLLLPPP
- Subject: RE: Quark-experts, HELLLLPPP
- From: email@hidden
- Date: Mon, 16 Dec 2002 11:39:59 -0500
Try this:
tell document 1 of application "QuarkXPress"
activate
repeat with i from 1 to count of text boxes
set style sheet of every paragraph of the current box to
null
set style sheet of every paragraph of the current box to
"text"
set pList to the object reference of every paragraph of
story 1 of the current box
if class of pList is not list then copy (coerce pList to
list) to pList
repeat with i from 1 to (the count of paragraphs in current
box)
set thisTextRange to (item i of the pList)
if (the text of thisTextRange) contains ":" then
set y to (offset of thisTextRange) + 1
set x to (offset of first character of
thisTextRange where it is ":") + 1
tell current box
set character style of characters
from y to x to "leader"
end tell
else
end if
end repeat
end repeat
end tell
Nan Mossey
Times Union Publications Manager
1 News Plaza
Albany NY 12212
518-454-5704
>
----------
>
From: Hans Haesler
>
Sent: Monday, December 9, 2002 6:18 AM
>
To: email@hidden
>
Subject: Re: Quark-experts, HELLLLPPP
>
>
On Mon, 09 Dec 2002, Hans Schoenmaker wrote:
>
>
>If got a quarkfile. On it's pages there are text boxes with 4 columns.
>
>Every column start with one or more words, then ":" end then more text.
>
>Now I want to apply stylesheets to these text parts.
>
>So I want to split the column text in text before and text from the ":"
>
sign
>
>And assign stylesheet to them.
>
>
Hi Hans,
>
>
let's say that the words at the beginning of the columns are key-words.
>
I guess that the style sheet for the rest of the text is the same for
>
each column. So, the best thing would be to apply this Paragraph style
>
sheet first, then loop through the paragraphs and apply the Character
>
style sheet for the key-words.
>
>
I guess that the text boxes have 4 columns and that you're using the
>
'next column' character for sending the text to the next column.
>
>
The following script expects one or more text boxes, the Paragraph
>
style sheet "text" and the Character style sheet "key_word".
>
---
>
tell document 1 of application "QuarkXPress 4.11"
>
activate
>
repeat with i from 1 to count of text boxes
>
tell text box i
>
tell story 1
>
set style sheet to "text"
>
repeat with j from 1 to count paragraphs
>
tell paragraph j
>
try
>
set character style of (text 1 thru character before
>
(character 1 of every text where it is ":")) to "key_word"
>
end try
>
end tell
>
end repeat
>
end tell
>
end tell
>
end repeat
>
end tell
>
---
>
This works for me.
>
>
But I fear that it can't be that easy and that the columns have more
>
than one paragraph and that these second or third paragraphs contain
>
a ":" character...
>
>
If this is the case then please come back with a better description
>
(or send me a sample document).
>
>
---
>
Hans Haesler <email@hidden>
>
_______________________________________________
>
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.
>
>
=========================================================
This e-mail message is intended only for the personal
use of the recipient(s) named above. If you are not
an intended recipient, you may not review, copy or
distribute this message.
If you have received this communication in error,
please notify the Albany Times Union Help Desk
(email@hidden) immediately by e-mail and
delete the original message.
=========================================================
_______________________________________________
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.