Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Making text lowercase
- TheNpcGuY452
-
Scratcher
12 posts
Making text lowercase
When i use ask block
ask [Choose a page to open] and waitSome pepole might ignore upper and lowercases. I need to turn all uppercases to lowercases and then submit the text:
Open (answer)So the point is there's pages to open an the names are listed on the project.
define Open (page name)
switch costume to (page name)
Show
- jmb1293634
-
Scratcher
1000+ posts
Making text lowercase
in the
<[] = []>boolean upper/lower cases are ignored except when using the
(costume [name v])block
- deck26
-
Scratcher
1000+ posts
Making text lowercase
Create a list of all the lower case characters. You can then build a copy of the text by joining each character in turn - use ‘item (item # of char in list) of list’ to get the lower case equivalent of the current character.
For example if your character is ‘A’ then item # of char in list will give you the item number of the ‘a’ so you can then append that character to what you have so far.
For example if your character is ‘A’ then item # of char in list will give you the item number of the ‘a’ so you can then append that character to what you have so far.
Last edited by deck26 (April 27, 2025 14:55:52)
- grandpasp
-
Scratcher
100+ posts
Making text lowercase
I don't think you need to convert the “answer” to lower case. That's a lot of work. Just make a list of your costume names. Then…
ask [Choose a page to open] and wait
if <[costume list v] contains (answer) ?> then
switch costume to (item ( (item # of [answer] in [costume list v])) of [costume list v] :: list)
end
Last edited by grandpasp (April 27, 2025 15:28:12)
- deck26
-
Scratcher
1000+ posts
Making text lowercase
I don't think you need to convert the “answer” to lower case. That's a lot of work. Just make a list of your costume names. Then…Sounds like a good way round the problem.ask [Choose a page to open] and wait
if <[costume list v] contains (answer) ?> then
switch costume to (item ( (item # of [answer] in [costume list v])) of [costume list v] :: list)
end
- Discussion Forums
- » Help with Scripts
-
» Making text lowercase