I'm excited to have finally purchased a license and explore Keyboard Maestro, I loved it during my trial!
I'm hoping someone here can provide some help as I'm unable to turn up any solutions on the web so far.
The issue
I'm trying to have a list in txt file which has 2 hierarchy levels, the first level start with "xx" and the second one "zz"
I want to automatise the replacement of the character with a one TAB for xx and two tabs for zz to recreate the hierarchy I had in a word document with indentation and save the list a .txt.
*Automatize the action search and replace searching for xx and replacing with %Tab% or with ^t however it doesn't write a tab and but it jumps to the next element (when I replace with %Tab%) or it just replace with ^t. I was able to write in the replace bar the tab by using the unicode Hex input and holding ⌥ + 0009 however I don't know to replicate this manual key sequence in KM. Can somebody help me or suggest an alternative way?
Thank you so much both for your suggestions, I was not expecting to receive an answer and a solution so quickly!
@Nige_S solution was the quick answer for including the tab character by ⌥⇥ and it fixed my issue, but thanks @ccstone for recommending BBEdit, I don't like at all TextEdit and this looks much better!
I also tried the macro you provided that reach the same result in a more elegant and quicker way, but I wouldn't be able to make it as I don't know AppleScript, thanks for building it!
For future reference, this task can be achieved using the built-in capabilities of TextEdit.
See the upside-down caret—properly known as a caron—denoted in the image above with the red arrow (to the right of the Find magnifying glass icon)? Whether the cursor is in the Find or the Replace Field, using that menu will offer special characters for searching/replacing.
(That Command-Option-Control-P shortcut may be custom to my setup.)
Hi @ccstone, would you know how to modify the great script you created to replace instead of the specific "xx" or "zz"
x with t/
x.1 with t/t/
x.1.1. with t/t/t/ ?
where x could be any number of a list and x.1 a sub level and x.x.1 sub-sub (example below). So that the script can recognise the hierarchy of a list regardless the specific written number but only counting N of levels?
Mammals
1.1) Lion
1.2) Elephant
1.3) Giraffe
Birds
2.1) Eagle
2.1.1) American Eagle
2.1.2.) Asian Eagle
2.2) Ostrich
2.3) Pigeon