• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Searching for and replacing text in a Quark Xpress text box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Searching for and replacing text in a Quark Xpress text box
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: default arguments/parameters
  • Next by Date: do shell script "mail...."
  • Previous by thread: choose different Screen Saver
  • Next by thread: Re: Searching for and replacing text in a Quark Xpress text box
  • Index(es):
    • Date
    • Thread