MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
text
Recherche

Using Text Transformations and Building Your Own On a Mac

lundi 23 mai 2022, 17:00 , par MacMost
You can use default text transformations on your Mac to convert text to upper or lower case, or to capitalize every word. However, it is better to use styling in Pages. You can also create your own custom text transformation with Shortcuts.



Check out Using Text Transformations and Building Your Own On a Mac at YouTube for closed captioning and more options.
Video Transcript: Hi, this is Gary with MacMost.com. Let's take a look at text transformations on your Mac.
MacMost is brought to you thanks to a great group of more than 1000 supporters. Go to MacMost.com/patreon. There you can read more about the Patreon Campaign. Join us a get exclusive content and course discounts.
So text transformations are a feature available on your Mac just about anywhere that you edit text. It allows you to convert lowercase to uppercase or do something special like capitalize each word. So to use it basically you're in an app like TextEdit here. Let's say I wanted to capitalize all the letters. I could just select this text and then go to Edit and then Transformations. Here you'll find the three built-in transformations. Make Upper Case, Make Lower Case, and Capitalize. If I use Make Upper Case you could see now every letter has been transformed to uppercase. Now I'm not sure why you would want to use that but you may actually find yourself with everything uppercase. Maybe you accidentally pressed the Caps Lock key and didn't notice until you were done typing the line or maybe somebody sent you some text like this and now you've got to convert it.
Well, you can now go to Edit, Transformations, and select Make Lower Case. This will lowercase every letter here. So you're going to have to go and Capitalize the beginning of sentences, maybe some proper nouns and things like that. But it's far easier than actually retyping the whole line. Now, Edit, Transformations, Capitalize will capitalize every single word. So the first letter is a capital letter and everything else is lowercase here. This could be handy for a number of reasons. Like making a headline or title. But it's never going to be just right if it's going to capitalize every single word. After all just about any headline or title I've ever seen is going to have this be a lowercase right there and perhaps some other words as well. But it's much easier to actually use the capitalize transformation and then change one letter than to go over the first letter of every word and change it. So those are the three basic text transformations. What I'm going to show you in a minute is how you can create your own.
Before that though let's take a look in Pages at an alternative to changing all the text. Suppose you have something like this and you want to have it all capitalized. Maybe this is the title for something and you want it to appear special and in all caps. Well, you could go to Edit, Transformations and Make Upper Case. But that would permanently change every letter to uppercase. If you wanted to go back it's really difficult especially if somethings in here were capitalized like names and such. You would have to convert back to lowercase and then carefully go through and change some of those to uppercase to get it back the way it was. Instead change the Style of the text. So I've got this selected and under Format, Style I can click here and under Capitalization there are some options. So, for instance, I can select All Caps. Now it seems to have done the same thing except it really didn't change the letters. Pages still knows that every letter there is either uppercase or lowercase. In this case the first letter is uppercase and the rest are lowercase. If I were to change this back to None it knows that. So it's just displaying them as uppercase. Not really changing them. Plus you have other options here. For instance, you can do Start case, which is similar to what we saw before. The first letter of every word is capitalized. But also Title Case which will be smart enough to know to not capitalize the T in the second the. There's also small caps which is kind of neat because all of the lowercase letters appear as small uppercase letters. It's something that could look nice in a headline or a quote or something like that. The great thing with all of these is you could always go back to None and it remembers exactly how you had everything before. So it's not a permanent change. More of a style change like making something bold or italic.
Now what if you wanted to have more transformations. Well, there's no way to add anything to here. But you can add to Custom Transformations easily with the Shortcuts app. So let's run Shortcuts and I'm going to add a new one. We'll call this Text Transform. Let's go to Settings here and use it as a QuickAction which will allow us actually to form a function on something selected. Like some selected text. Let's have it provide Outputs so it can transform that text and replace what you have selected. Now let's go here to what it receives. We don't want it to receive Any. We're going to Clear that. Then we're going to go back in and we're going to set it to receive Text or Rich Text. That's it.
So now it's going to take the text in and give the same text back out BUT we can add an action in-between those two things. So let's look for Transform and there's one called Change Case. Let's look at the Help on that. You could see it can do Uppercase, Lowercase or Title Case. In fact it can do much more. Let's drag it in and put it right there. So it's going to take the Shortcut Input, change it to Uppercase, and Output it. If I click on uppercase here you can see that it can do more than just uppercase and lowercase. It can also capitalize every word which we already have. These three are just like the first three in the Edit Menu. But we have some other things here like Title Case. Let's use that and test this out. Now remember I've got this set to be a QuickAction. So in TextEdit here I can select the text and I'll find QuickActions in the Services Menu. Here's Text Transform. I'm going to use this and notice how it correctly didn't capitalize the t in the second the. So Title Case works a lot better.
Let's make things a little more difficult. You could see here I've added a few other words here, in and on in particular are sometimes capitalized and sometimes not in headlines depending upon your style, a shouldn't be capitalized and iPhone has a unique capitalization with a lowercase i and a capital P. So let's go and try this. In the Services Menu select Transform Text and this is what we've got. So it correctly did iPhone. It also correctly left a as lowercase. But in and on could be capitalized, could be lowercase, it depends on again the style you are following and in a lot of styles it depends on how these words were actually used.
So let's go and create our own variation that will capitalize in and capitalize on and this is just an example. You may actually have other things that you may want to change about how title case works. So here in Text Transform let's look for Replace and there's Replace Text. I'm going to add that here after it capitalizes everything. Let's replace the word in with capitalized In. But we don't want it to do it any time the two letters are found next to each other. So we're going to do Space in and replace that with Space capital In. More or less this should work for every time the word in appears. After all, i and n are the first two letters of any other word should be capitalized to begin with. It's just when it's this word that it's a problem. Let's do the same thing here with on. Space on replace with Space capital On. So after capitalizing the title case it's then going to do something special with in and special with on. Now we can go and select this text. I'll go to the Services Menu. Text Transform and you could see now in and on are correctly capitalized.
There are a couple other transformations here. You've got Capitalize With Sentence Case which just leaves the first letter capitalized. Lowercase is everything else. You've got Capitalize With Alternating Case which can be used for emphasis or just for fun. Of course you can do a lot more with these replacements here. In fact if you are good with regular expressions notice that the Replace Text function will actually take and use a regular expression and you have other regular expression functions in Shortcuts as well. So for more advanced programmers you could basically use Regular Expressions to create all sorts of complex transformations.
Hope you found this useful. Thanks for watching.Related Subjects: Pages (175 videos), Shortcuts (34 videos)
Related Video Tutorials:
Building a Table Of Contents In Mac Pages ― Building a Quiz With Mac Keynote ― Building Your Own Cheap External SSD Drive For Your Mac ― Building a Clock Overlay For Your iMovie Videos
https://macmost.com/using-text-transformations-and-building-your-own-on-a-mac.html
News copyright owned by their original publishers | Copyright © 2004 - 2024 Zicos / 440Network
Date Actuelle
mer. 24 avril - 06:30 CEST