txt.swap - interactively swap text at a certain character or word

Post your working scripts, libraries and tools
User avatar
davebrny
Posts: 83
Joined: 05 Dec 2016, 06:26

txt.swap - interactively swap text at a certain character or word

11 Nov 2017, 15:35

i made this because doing a search for "train times from this place to that place" and then having to swap around or re-type the "that place and this place" to get the return times is a pain in the ass

its also useful for some ahk commands:

highlight "this, something_else"

Code: Select all

stringReplace, string, string, this, something_else, all
press alt + s, then type a comma and once youre happy with the swapped text at the bottom of the tooltip, hit enter to paste the swapped text

Code: Select all

stringReplace, string, string, something_else, this, all
- use alt + shift + s to repeat the last swap without showing the tooltip
- backspace can be used to "undo"
- use the esc key to close the tooltip

note:
- this doesnt do anything if multiple lines are selected
- the whitespace on either side of the swapped character/word isnt swapped





related scripts:
txt.wrap - wrap selected text in *symbols*
txt.replace - interactively replace a character with another

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Frosti, robodesign and 46 guests