[TxMt] Re: Recording macros

Joseph Pecoraro joepeck02 at gmail.com
Thu Jul 17 18:43:13 UTC 2008


Try these steps:

1) Put cursor in middle of a word
2) Start recording macro
3) Ctrl+W (Selects the entire word, this is easier then the two step  
ctrl+left, ctrl+right, and works if the cursor is right before the  
first char of the word!)
4) Command+E (Puts the word into the 'Find' part of the Find dialog  
without opening the dialog)
5) Command+G (Searches for the next occurance of the 'Find' word in  
the Find dialog without opening the dialog)
6) Stop recording macro

The reason your version wasn't working before was that when you opened  
the find dialog and ran search, the macro was only recording the  
single "real action" that was taking place... searching for whatever  
word was in the "Find" buffer.  It then records that in the macro as  
"perform a search with the given hardcoded word"  In the macro above,  
using Command+E (also known as Apple+E) is an action to put the  
current word into the "Find" buffer.  That action is recorded by the  
macro.  Same with the Command+G action later.

I know that I didn't use the correct terminology, maybe someone can  
explain it a little better, but that is my reasoning of why your macro  
was not working.

Joseph Pecoraro

On Jul 17, 2008, at 2: 23PM, Ritesh Nadhani wrote:

> Hello All
> Been using TextMate for 2 weeks now and love it.
> I am trying to create a macro to search a word under the cursor when  
> I press Ctrl+. These are the steps I follows: http://pastebin.com/m4418e1bd 
>  and this is what I get in macro editor: http://i36.tinypic.com/344cwm1.png 
>  . It seems to be working but when I press Ctrl+. next, it searches  
> for the word that I used to record the macro and not the current  
> word under the cursor.
> What am I missing or doing wrong?
> -- 
> Ritesh
> http://www.riteshn.com
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080717/054bf0a5/attachment.html>

More information about the textmate mailing list