Re: Quark Xpress again (style spec)
Re: Quark Xpress again (style spec)
- Subject: Re: Quark Xpress again (style spec)
- From: Shane Stanley <email@hidden>
- Date: Thu, 10 Oct 2002 21:41:07 +1000
On 10/10/02 8:43 PM +1000, Gvran Ehn, email@hidden, wrote:
>
OK, here is how I planned from the beginning:
>
tell text box (item k in my_list) of document 1
>
set my_styles to get name of style sheet of text style ranges of paragraphs of
>
stories
>
set my_texts to get text style ranges of paragraphs of stories
>
end tell
>
In my mind the command "style sheet" would get both the paragraph style and
>
the character style applied to all stories in a text box, but this was not
>
reality
Right; that's not going to work. In fact you're not going to get either
style with that code, because style sheets are properties of paragraphs, not
text style ranges.
>
now here is my problem, I still want to get all the text in a box at
>
once but it does not work this way, I only get the paragraphs style with the
>
code above.
I think you'll actually get an error (once you change "stories" to "story
1").
>
Maybe its possible to extract them separately but how to keep
>
track of the text so that it can be reimported in the correct order, i.e.
>
after content translation? The way I see it I will get a character style into
>
one list and paragraph style into another and when extrating from those list I
>
will loose the order of the text in the stories.
I think what you're trying to do is something like this:
tell application "QuarkXPress 4.11"
tell story 1 of current box
set parStyles to name of style sheet of every paragraph
set charStyles to name of character style of every text style range
set theText to contents of every text style range
end tell
end tell
set newText to ""
repeat with i from 1 to count of theText
set newText to newText & "<cs:" & item i of charStyles & ">" & item i of
theText
end repeat
set newText to paragraphs of newText
set finalText to ""
repeat with i from 1 to count of parStyles
set finalText to finalText & "<ps:" & item i of parStyles & ">" & item i of
newText & return
end repeat
return finalText
But you might well do better to just save the story as tagged text, and work
from there.
--
Shane Stanley, 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.