--- In [email protected], "tlgimmer777" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to write a macro that would put parenthesis around a 
> "word"  
> in an order that could look like this: orders.sub_total
> 
> Here's my try:
> *Keys (^f
> wait.for (150)
> *Keys {to Find/Replace}[{^}a-zA-Z0-9\._]%n
> wait.for (150)
> *Keys {to Find/Replace}{esc}{left})
> quit
> 

Which editor?

You can get the focus of starting window at the beginning and set
focus back to that window at the end.

local editor=win.getfocus()
...
setfocus(editor)

You can probably use win.close("Find/Replace") instead of sending esc
if the esc is problematic.

After ^f, instead of waiting strictly by time, you could wait for the
active window to be "Find/Replace"

wait.for(1500,activewindow("Find/Replace"))

Shouldn't you be doing a Replace to get the parentheses?



Reply via email to