Searching for and replacing text in a Quark Xpress text box
Searching for and replacing text in a Quark Xpress text box
- Subject: Searching for and replacing text in a Quark Xpress text box
- From: Bis <email@hidden>
- Date: Thu, 9 Oct 2003 17:06:50 +0100
Hi
I have got here a fragment of code here which enables me, in an open
document, to
1) search for a text box with a particular stylesheet ("DA Dateline")
applied to it
2) specify the text contained in the box ("26 DECEMBER 2003") and
3) replace it with a date of my own choosing ("newDate").
set textBoxes to (object reference of every text box) --get number of
text boxes
if the class of textBoxes is not list then ,
copy (coerce textBoxes to list) to textBoxes
repeat with thisBox in textBoxes --iterate through each text box
tell thisBox
set theStyle to the name of the style sheet of paragraph 1
if theStyle contains "DA Dateline" then
find and replace all "26 DECEMBER 2003" by newDate
--need to find a way of replacing all text in paragraph/box
--also a way of specifying stylesheet name including ".feature" suffix
end if
end tell
end repeat
end if
What I want to do, however, is to be able to
1) search for a text box with a particular stylesheet ("DA Dateline")
applied to it
2) get whatever text it contains
3) replace the text it contains with whatever I want to replace it with
I have looked in Shirley Hopkins' book which details how to add text
to a text box (page 125) but I have been unable to find how to
replace whatever the text box contains with what I want.
Any help would be gratefully appreciated.
--
Bis
_______________________________________________
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.