Still getting familiar with AS, trying to make something where you type in a string and it spits out another based off of a code.
display dialog "string to encode" default answer ""
set stringtoencode to text returned of result
set encoded to {}
set code to {a:"b", b:"c", c:"a"}
repeat with i from 1 to (count characters of stringtoencode)
set end of encoded to ((character i of stringtoencode) of code)
end repeat
display dialog encoded as text
Keeps giving me “Can’t get stringtoencode of {a:“b”, b:“c”, c:“a”}.” and I’m assuming it’s because I can’t retrieve an item from a record using a variable. Is this why I’m having a problem? Is there a (simple) way to fix this?