[TxMt] Macro Recording with Search?

David Wooten wooten at berkeley.edu
Mon Dec 27 01:43:48 UTC 2004


For a somewhat finer twist on this, is it possible to pass a variable 
(e.g. $TM_SELECTED_TEXT) to the Find clipboard?

This would be a way to achieve a "find the next instance of X" in a 
macro, which would be a different X in each text block. Perhaps there 
is already a way to do this which I haven't found.

Many thanks,
D. Wooten

On Dec 23, 2004, at 1:03 AM, Allan Odgaard wrote:

> On Dec 23, 2004, at 1:15, David Wooten wrote:
>
>> I've been experimenting a little with the macro recording feature, 
>> and one thing I'd find rather useful would be to include a search in 
>> it. Is this not yet possible?
>
> That is possible. You can either use the find next/previous actions to 
> find what's on the find clipboard (when the macro is replayed), or you 
> can use the find window to find a specific string (with specific find 
> options), which is then independent of the contents of the find 
> clipboard, when the macro is replayed.
>
>> The idea is that one would search for the next instance of a certain 
>> word, and then base the rest of the macro off of the location of that 
>> word. This is good, for example, for reformatting bbl (bibtex) files 
>> in ways that are not supported natively.
>
> When I need a macro which 'starts' its action after a certain string, 
> I often have the last action in the macro do the find. That way, I can 
> replay the macro repeatedly, until I hear a beep, which indicates that 
> there are no more blocks of text that needs to be worked upon (i.e. 
> the last find of the last macro replayed fails).




More information about the textmate mailing list