Let's say I have a script:
set hi to 7
run script "display dialog hi"
When I run it, it says that hi
is undefined.
Is there a way to make hi
accessible from the run script
command? If not, what else can I do? The real application for this is to change a variable name. What I do now is:
repeat (random number from 0 to 5) times
set rand2 to (random number from 0 to 7) + 97
set rand to (random number from 0 to 7) + 97
set switch to rand2
run script ("set " & (ASCII character rand) & "1 to " & (ASCII character rand2) & "1")
run script ("set " & (ASCII character rand2) & "1 to " & (ASCII character switch) & "1")
run script ("set " & (ASCII character rand) & "2 to " & (ASCII character rand2) & "2")
run script ("set " & (ASCII character rand2) & "2 to " & (ASCII character switch) & "2")
end repeat
But that doesn't work. Is these I workaround for this?
Thanks