Macros: making progress

Have a problem? A question? This is the place for answers from other Express users.
Post Reply
Kaveh Bazargan
Posts: 9
Joined: 2005-07-29 06:35:13
Location: UK
Contact:

Macros: making progress

Post by Kaveh Bazargan » 2005-08-02 02:45:37

I have posted twice with no replies. Really hoping I'll have some feedback now. ;-)

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
But it does not see a window with "Find" in the name.

Can anyone comment or suggest anything? A pointer to some examples would be useful.[/b][/code]

Post Reply