
Here's what I want to do:
Change the color of all text matching a regular expression to red
Can't use perl because it can't do text styles (yet).
Can't do just menu commands, as I can't put in the text to be found.
So try AppleScript. I am trying a way to open the find window, paste an expression, then continue from there. But I can't get AppleScript to see it as a window. I have written the following script.
Code: Select all
tell application "Nisus Writer Express"
activate
Do Menu Macro with macro "Edit:Find:Find…"
-- set color of selected text of document 1 to "red"
copy the (count of windows of frontmost application) to num
repeat with i from 1 to the num
if name of window i contains "Find" then
display dialog (name of window i) as string
end if
end repeat
end tell
Can anyone comment or suggest anything? A pointer to some examples would be useful.[/b][/code]