I have a problem when using a list. I run a handler togehter with a 2 dimensional list which is part of another script. The code in the handler works then through the elements of the list.
The code looks something like this:
put (("NameOfSomeImage1", "WhatTextToEnter1"), ("NameOfSomeImage2", "WhatTextToEnter2")) into global PointToClick_ValueWhatToEnter_List
run _Library_Script.NameOfSomeImage_WhatTextToEnter
I can now use the same handler with a different amount of 2dimensional items of that list. I can extend it to 3 dimensional items or to 4.
But if I reduce it to only one 2dimensional item, like:
put (("NameOfSomeImage1", "WhatTextToEnter1")) into global PointToClick_ValueWhatToEnter_List
the handler code fails. The list only seems to contain the 1 item of the 2dimensional list. The second returns to be empty. Why is that?
The handler code looks like:
repeat with each item of global PointToClick_ValueWhatToEnter_List
if it is not empty then put it into 2dimensionalitem
put item 1 of 2dimensionalitem into part1
put item 2 of 2dimensionalitem into part2
click on part1
typetext part2
end repeat
If I change the code to:
put (("NameOfSomeImage1", "WhatTextToEnter1","","")) into global PointToClick_ValueWhatToEnter_List
The first repeat run is ok, part1 and part2 are properly used, but the repeat fails because for the subsequent empty values the handler code fails with an error and the script stops, which it should not. because the script handler call is part of a longer list of calls and there are many more which follow
I hope someone has an idea whats going on…
P.S. I use Eggplant Starter Edition…