text box 1

Need to replace text in my text box 1. I need to replace the word Example with my newtext that is set to Great. What I now is the text to be replaced is in text box 1 and the word is example how do I put my set text in its place.


set newtext to "Great"
tell application "QuarkXpress"
     tell document 1
          set tool mode to contents mode
          set replace text "Example" of text box 1 to newtext
     end tell
end tell

Voila:

Jon

Umm, let me amend that. Instead of word, let’s make it text so you can search on strings longer than a single word. Also, put in a try so that if there are no matches for the search_string we can trap the error QXP throws:

Jon

I am usig quark 5, Mac OS 9.2 and getting an error message. on this line

set text of search_ref to change_string

QuarkXpress got an error: A descriptor type mismatch occurred

Hello, i am trying to search a text box in quark and swap what is found with a different word. i need to do this in a script to speed things up. I have tired different key words i think would used but to no avail. Please help with the syntax
Do I need RegEx_Commands OSAx to do so. If So where can i download it from because the one at www.osaxen.com gets an error page

I just booted back into 9.2.1 and QXP 5.01 and the code worked without a hitch. Maybe you’ve got an XTension conflict.

Jon

It worked now I upgraded my quark to 5.01 for some reason it didn’t want to work in quark 5
Thanks jon