Is it possible to save a macro that uses the find & replace dialogue box?
Lets say I want to save a macro that uses find & replace with a regular expression to surround any number with ³**". For example, the macro would replace any instances of ³123" with **123**. Is this possible?
Thanks Ross
On 19 Sep 2013, at 15:00, Ross Ahmed wrote:
Is it possible to save a macro that uses the find & replace dialogue box?
Yes, the button you press in the dialog, while recording a macro, will cause the window’s current state to be saved (in the macro) with the action, as opposed to using something like Edit → Find → Find Next, which only put “findNext:” in the macro (using the current search string).
Lets say I want to save a macro that uses find & replace with a regular expression to surround any number with “**". For example, the macro would replace any instances of “123" with **123**. Is this possible?
1. Edit → Macros → Toggle Recording 2. Edit → Find → Find… 3. In find dialog use: - Find: `\d+` - Replace: `**$0**` - ✓ Regular Expression 4. Click “Replace All” 5. Edit → Macros → Toggle Recording 6. Edit → Macros → Save Macro…
When you save the macro, you can see how your actions got interpreted and can make minor edits to the property list in the bundle editor.
It works well. Many thanks for creating an amazing product!
From: Allan Odgaard mailinglist@textmate.org Reply-To: TextMate users textmate@lists.macromates.com Date: Friday, 20 September 2013 12:13 To: TextMate users textmate@lists.macromates.com Subject: [TxMt] Re: Macro that uses find & replace
On 19 Sep 2013, at 15:00, Ross Ahmed wrote:
Is it possible to save a macro that uses the find & replace dialogue box?
Yes, the button you press in the dialog, while recording a macro, will cause the window’s current state to be saved (in the macro) with the action, as opposed to using something like Edit → Find → Find Next, which only put “findNext:” in the macro (using the current search string).
Lets say I want to save a macro that uses find & replace with a regular expression to surround any number with “". For example, the macro would replace any instances of “123" with **123. Is this possible?
1. Edit → Macros → Toggle Recording 2. Edit → Find → Find… 3. In find dialog use:
- Find: \d+
- Replace: **$0**
- ✓ Regular Expression
4. Click “Replace All” 5. Edit → Macros → Toggle Recording 6. Edit → Macros → Save Macro… When you save the macro, you can see how your actions got interpreted and can make minor edits to the property list in the bundle editor. _______________________________________________ textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate