i have written a simple script to do some various searched within a selection in Quark 6. Each part of the script seem to work by themselves, but when they are put together I get an error after the first part is complete. If i run the scriot again I get the next section to work OK, but then errors again and so on… untill the search is complete. Any Ideas?
tell application “QuarkXPress”
activate
set mytext to return
set mytab to tab
set mypound to “£”
set myspace to " "
tell document 1
set myselection to selection
tell myselection
set mysearch to a reference to (text of myselection whose contents = “.” & myspace & myspace & myspace)
set contents of mysearch to “.” & tab
set mysearch2 to a reference to (text of myselection whose contents = myspace & mypound)
set contents of mysearch2 to mytab & mypound
set mysearch3 to (a reference to (text of myselection whose contents = mytab & myspace))
set contents of mysearch3 to mytab
set mysearch3 to (a reference to (text of myselection whose contents = mytab & myspace))
set contents of mysearch3 to mytab
set mysearch3 to (a reference to (text of myselection whose contents = mytab & myspace))
set contents of mysearch3 to mytab
end tell
display dialog "End"
end tell
end tell