Attempting to have a form_base call upon variables from an inline-script
As the title says, I'm attempting to have variables displayed in an inline script to no avail.
Specifically, I am trying to pull from two lists and create a 2x2 array with image buttons and the images appear in a random location.
Below is the barebones of my failed script:
Inline script1
List_1=["example1.jpg", "example2.jpg", "example3.jpg"]
List_2=["Alpha_example.jpg", "Beta_example.jpg"]
shuffle(List_1)
shuffle(List_2)
Loop
set source_file ""
set source table
set repeat 1
set order random
set description "Repeatedly runs another item"
set cycles 1
set continuous no
set break_if_on_first yes
set break_if never
setcycle 0 empty_column ""
run new_sequence_1
Inline script2
a=List_1.pop()
b=List_1.pop()
c=List_1.pop()
d=List_2.pop()
stimuli=["a","b","c","d"]
Location1=stimuli.pop()
Location2=stimuli.pop()
Location3=stimuli.pop()
Location4=stimuli.pop()
form_base text:
set timeout infinite
set spacing 2
set rows "1;1"
set only_render no
set margins "5;5;5;5"
set description "A generic form plug-in"
set cols "1;1"
set background black
set _theme gray
widget 0 0 1 1 image_button path="[Location1]" var=_0
widget 1 0 1 1 image_button path="[Location2]" var=_1
widget 0 1 1 1 image_button path="[Location3]" var=_2
widget 1 1 1 1 image_button path="[Location4]" var=_3
Comments
Hi TroyS,
Use
var.Location1
etc like described here:Also make sure you put it in the prepare of an inline_script. See:
Best,
Jarik