I have a client using Quark, and we are trying to strip text out of their documents (one article at a time) and put the info in a database for publication on the web. The script below (although it needs a lot of work), basically getting some of it done.
tell application "QuarkXPress Passport"
activate
set thisbox to current box
set wordcount to count of (words of thisbox whose style is italic)
repeat with loopvar from 1 to wordcount
set theWord to (object reference of first word of thisbox whose style is italic)
set style of characters in theWord to plain
set text of theWord to ("<i>" & (text of theWord) & "</i>")
end repeat
set every text in thisbox where it is "</i> <i>" to " "
set wordcount to count of (words of thisbox whose style is bold)
repeat with loopvar from 1 to wordcount
set theWord to (object reference of first word of thisbox whose style is bold)
set style of characters in theWord to plain
set text of theWord to ("<b>" & (text of theWord) & "</b>")
end repeat
set thistext to text of thisbox
end tell
problems:
- this code doesn’t REALLY do what I want… I was trying to use ‘text style ranges’ but just couldn’t get it to work.
- text that is plain AND bold is not processed for the bold style
- since this is based on getting the text of the text box, when the client uses chained text boxes, the text outside this box is not processed.
I’ve been working on this for a while and Quark Applescript has always been a problem for me!
Any help or suggestions would be greatly appreciated.
Thanks in advance for your time!
Steve