Variable creation by script
Variable creation by script
- Subject: Variable creation by script
- From: Paul Skinner <email@hidden>
- Date: Mon, 29 Jan 2001 11:31:19 -0500
Ok, I've tried this repeatedly, and I've searched the archives that I
have available locally including the 'variables on the fly' thread. I must
be missing something basic.
I want to create a variable within a script and assign it a value. This
I can do. But when I subsequently query that variable it errors as not
defned.
Here's the simple example that I'm working on.
--Begin script
set listIndex to "1"
--> "1"
set scripttext to "set testList" & listIndex & " to {\"a\",\"b\"}"
-->tell current application to ,
--> run script "set testList1 to {\"a\",\"b\"}"
--> {"a", "b"}
run script scripttext
--> {"a", "b"}
return testList1
--> The variable testList1 is not defined.
--End script
Now, I've tried making the variable global in the defining script object
and I've tried creating it as a property. Neither changes the result. I
tried holding my mouth crooked when I run it, and I shook my rubber chicken
at the box repeatedly. What have I forgotten?
--
Paul Skinner