It is currently February 5th, 2023, 8:24 pm

Script lua for text in uppercase, lowercase and type of sentence (Scritp lua, texto en mayusculas, minusculas y oracion)

Quote of the Day, To-Do List and other text-based skins
User avatar
balala
Rainmeter Sage
Posts: 14938
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Script lua for text in uppercase, lowercase and type of sentence (Scritp lua, texto en mayusculas, minusculas y orac

Post by balala »

FernandoAleisy wrote: April 23rd, 2019, 5:34 pm Script lua to show the text in uppercase, lowercase or sentence format in a string meter in Rainmeter.
Your code is for sure useful in many cases, however sometimes a much easier solution does exist: you can add a StringCase option to the String meters. It has four possible values:
  • None - the string isn't altered, it is show as it is.
  • Upper - All letters converted uppercase.
  • Lower - All letters converted lowercase.
  • Proper - The first letter of all words is converted uppercase. Here is a great difference, because using the ora function of your lua script, you get uppercase only the first letter of the whole string, while setting the StringCase to Proper sets uppercase all first letter of all words within the string.
Again, please don't misunderstand me, your code can be and is useful in many cases, I just wanted to show an (at least sometimes) usable alternative.
User avatar
balala
Rainmeter Sage
Posts: 14938
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Script lua for text in uppercase, lowercase and type of sentence (Scritp lua, texto en mayusculas, minusculas y orac

Post by balala »

FernandoAleisy wrote: April 23rd, 2019, 6:57 pm The StringCase modifies all the text that is shown in the meter.
Not necessarily. You can use the Case setting of an Inline to get modified the string only partially.
User avatar
balala
Rainmeter Sage
Posts: 14938
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Script lua for text in uppercase, lowercase and type of sentence (Scritp lua, texto en mayusculas, minusculas y orac

Post by balala »

FernandoAleisy wrote: April 23rd, 2019, 8:03 pm I have to study Inline
Yep, it's an interesting option, added on July 31, 2015 (version 3.3.2423) to the String meters, which indeed worth to be studied a little bit.
However I don't contest the benefits of your code. In many cases it can be useful and don't be disappointed by my reply to your initial message, your code is definitely useful. Just had to add that comment.
User avatar
balala
Rainmeter Sage
Posts: 14938
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Script lua for text in uppercase, lowercase and type of sentence (Scritp lua, texto en mayusculas, minusculas y orac

Post by balala »

FernandoAleisy wrote: April 23rd, 2019, 10:39 pm Of course, if it's not an inconvenience for you.
No, it's never. I'm happy to help whenever I have enough time and energy. Other times you have to wait for a while.