I keep getting an error saying "Can not make “first character of charSeq into a number.”
No where in my code do I have anything trying to set it into a number/integer. The only other code is properties defined above, none of which are set to numbers/integers. Am I missing something?
What I’m trying to do is get the charSeq variable and make a list of the characters, for example: “Hello” would become {“H”,“e”,“l”,“l”,“o”}
if the contents of text field "charSeq" of window "main" is not equal to "" then
set charSeq to the contents of text field "charSeq" of window "main"
repeat with i in characters of charSeq
set theList to theList + i as list
end repeat
end if
display dialog theList
Also, this is my first time using the Repeat function, if anything is wrong or could be more efficient, I’m listening.
set theList to {}
set charSeq to "Hello"
--option 1
set theList to characters of charSeq
--option 2
repeat with aCharacter in characters of charSeq
set end of theList to aCharacter
end repeat
--option 3
repeat with i from 1 to count characters of charSeq
set end of theList to character i of charSeq
end repeat
Okay so there are more than 3 ways, but lets start there.
I got my application to work perfectly now. What I was making was a Key generating program. Where you decide what the outcome will be by providing a sequence (For example: “aaA#-##AA-#Aaa”). It will then pick a random capitalized letter for every “A”, lower case letter for every “a”, and so on. Work’s great!