And there might be others.īut, totally separate from my personal use cases, I really do think that there’s a reusable pattern here: I can see the value of an easy keyboard shortcut for those, too. Another is the links format, which were subject to whim, apparently. One of them is fixing the years when I thought sentence case “worked” for post titles on my blog, for which I have an easy keystroke shortcut. And honestly, why should they? They give me enough information, I take it from there, we’re both doing our jobs.)Īnd so, as I was working my way through these old posts, it occurred to me that many of the edits I was making were formulaic. (You would not believe how many engineers cannot master Title Case, when they can master indentation and termination and other syntax rules. I’ve become very accustomed to being able to select, keyboard shortcut, title text is fixed. Multiple passes! Fun! I wish it were not true, but I’ve arrived here after quite a few experiments.īut, totally separate from that, in my day job (tech writer) I regularly have occasion to edit other people’s material, or even my own. Every post is getting visited and revised, one at a time. I can’t solve all of them by search-and-replace. And (because reasons) they’ve been neglected for many years, and there are a lot of other problems. I would not be here, I would be in BBEdit! (Or, I admit to using Sublime and VS Code and TextMate, too…)įor this particular “project”, I’m working my way through ~15 years of blog posts (personal), across several sites. Oh, how I wish I could dump the database to SQL and run a search-and-replace. They can definitely be improved, but the problem I have is putting them into a script that can use them.Īnybody know of a good example of doing this? My examples aren’t particularly solid, I just knocked them out to have something to write the rest of the script with. I don’t really need help with the regular expressions part. Perl is great, Ruby is great, COBOL, whatever works. I have no specific interest in using any scripting language to do this. But I didn’t find anything that looks likely. This seems like such a straightforward and generally usable tool that I was hoping to find something ready-made here on Automators. I would love to just re-use shell with some changes to handle the find/replace pairs, but that Perl is … I’m not a Perl guy. Here’s two examples of substitutions I want to do: I want to select an existing link, run the quick action, and output a modernized version of the link. My specific use case is that I’m cleaning up a lot of old content that used multiple different formats for creating links. If it finds one of those patterns, it uses a substitution pattern to alter the text in some way, returns that text, and stops trying to match patterns.If it doesn’t match the first pattern, it tries the next, and the next, in a loop.The script takes the text, and uses regular expressions to match specific possible patterns.I’d like to create a similar script, for different text processing. I also add a keyboard shortcut for the quick action, in System Preferences > Keyboard > Shortcuts > Services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |