I'm pasting a string into the find dialog in a macro and getting strange results. Using
WinXPsp1 and TP472. Two documents open in TP. Macro records ok and I save it with the
option to execute once. When I run it, step 4 is never executed. What am I missing? TIA!
1.Home, Shift-End, Ctrl-C Goto start of line, Select it, Copy it
2.Ctrl-Tab, Ctrl-Home Switch to other open document, Goto the
start/top of it
3.F5 Open find dialog
4.Ctrl-V Paste into entry box
5.Alt-M, Esc Mark found lines, Exit the find dialog
6.Ctrl-Tab, Home, Arr-Down Switch back to other open document,
Goto start of line, Get ready to select
next line
Then I open up and see
the person fumbling here is me
a different way to be
Help - Help Topics - Content - How to... - Use Keystroke Macros - Overview:
Points to bear in mind:
- Except where otherwise noted, typing in dialog boxes is not recorded.
- If you record a Find Next or Previous command, the current search string will be used. i.e. the search string will not be recorded, so when you play it back, it will try and find a pattern matching the last search string used.
Thx for the point MudGuard, I just looked at the Macro Examples again and saw my error,
in the examples the recorder is started after you type your data in the find dialog. *urgh*
Then I open up and see
the person fumbling here is me
a different way to be
I think that TextPad records your pasting value into the macro when you run it the first time. If you later have something in the clipboard, and run the macro, the clipboard contents won't be pasted into Find field, it will be the same value as when you first recorded it.
Another macro program alternative to AutoIt is Macro Scheduler
//Macro Scheduler 7.2.050
Label>Start
Press HOME
Press SHIFT
Press END
Press CTRL
Send>c
Release CTRL
Press CTRL
Press TAB
Press Home
Release CTRL
Press F5
Press Ctrl
Send>V
Release CTRL
Press ALT
Send>M
Press ESC
Press CTRL
Press TAB
Press HOME
Release CTRL
Press DOWN
Goto>Start //Insert IF conditions here to loop/Stop
Both Macro Scheduler and AutoEdit are editable. TextPad macros are not. (Use TextPad to do the editing with Syntax and Clip Libraries).
Just gave that script a quick run, it does not work. Mind you, it's the first time I ever saw AutoIt and I just downloaded it so I'm using version 3.0.101 (get with the times CyberSlug! )
When ran just once it leaves the find dialog in a mess. Is there a quick start quide out there for AutoIt? I'm not sure I'm starting the script correctly.
s_reynisson wrote:Just gave that script a quick run, it does not work.
I probably should have warned you script was untested because I don't use TextPad keystroke compatibility and "Changing the emulation [would kill] all custom key assignments."
The AutoIt help file (AutoIt.chm) is a really good place to start. Especially look at the Send and WinWaitActive functions.
I think this might work My script would fail if the 'Cannot find' dialog pops up.
WinWaitActive("TextPad") ; wait for TextPad window
$Line=InputBox("Mark All", "How many lines?", "", "")
$curr = 1
while $curr <= $Line ; loop number of times
WinActivate("TextPad") ; activate TextPad window
Send("{Home}+{End}^c") ; highlight current line & copy to clipboard
Send("^f") ; open 'find' dialog box
Send("^v") ; paste from clipboard
Send("{Tab 8}{+}{Tab 2}{ENTER}") ; ensure In all documents checked and Mark All
WinActivate("TextPad") ; re-activate TextPad window
Send("{Home}{Down}") ; get next line
$curr = $curr + 1 ; increment loop control
wend