--- In [email protected], "tlgimmer777" <[EMAIL PROTECTED]> wrote:
>
>
>
> Sheri,
>
> Thanks for the great tips. I did get it to work with:
>
> KeyTrap.SendKeys("(^f")
> wait.for(1500,activewindow("Find/Replace"))
> KeyTrap.SendKeys("[{^}a-zA-Z0-9\\._]")
> wait.for (400)
> KeyTrap.SendKeys("%n")
> wait.for (300)
> win.close("Find/Replace")
> wait.for (50)
> KeyTrap.SendKeys("{left})")
>
> quit
>
>
> The win.close seemed to work better than the win.setfocus. Using
> replace is a great idea, I hadn't thought of it. I messed with it
> for a while, then gave up. I had a hard time getting the reg exp
> into the replace text field. I'm using cfeclipse as an editor. I
> think I can really jazz up the auto complete using the above
> script as a framework.
>
> I think the whole thing would work better if I could somehow
> avoid the Find/Replace dialog box, somehow just stuff the search
> buffer with the reg exp without messing with the dialog box.
That app is not something I use. Just for grins I looked at eclipse
and tried making a macro for your task. This worked (one line, no spaces):
win.keys("{fast}^f{w3}%f^a{^}[{w3}a-zA-Z0-9\\._]{pl}{w3}{tab}($0){w3}%x{+}%a{w5}{esc}")
Also this (Yahoo will break some lines):
win.setfocus(window("firstwindow", "==eclipse"))
win.sendkeys("{sinp}{to Java*}^f")
wait.for(1500, activewindow("Find/Replace"))
local l=win.childhandlelist("Find/Replace")
win.settext(win.handlefromindex("Find/Replace", 5),"^[a-zA-Z0-9\\._]+")
win.settext(win.handlefromindex("Find/Replace", 8),"($0)")
win.sendkeys("{sinp}%x{+}{w3}%a")
wait.for(1500, win.gettext(win.handlefromindex("Find/Replace",31)) ne "")
win.close("Find/Replace")
Both replace all xyz.xyz with (xyz.xyz) using XP. The first would have
problems in Vista because of {fast}
Another approach would be to copy to the clipboard, regex the
clipboard with PowerPro, then paste from the clipboard.
Regards,
Sheri