The variable inspector provides an overview of all the variables that are used in your experiment and could be logged using a logger item. Local variables (i.e., variables that are only available from within an item, such as 'duration' in a sketchpad item) are not shown. The variable inspector tries to extract variables created in an inline_script item, although slight mistakes may occur.
For more information, see http://www.cogsci.nl/blog/tutorials/106-using-variables-and-conditionals-qif-statementsq-in-opensesame.
The preferred way to set variables in an inline script item is by using:
self.experiment.set('var_name', value)
The preferred way to retrieve variables in an inline_script is by using:
value = self.get('var_name')
You can also get and set variables more directly, using:
self.experiment.var_name = value
and
value = self.experiment.var_name
This will usually work equally well, but is not preferred as it circumvents OpenSesame's interval variable management system.
The command
self.set('var_name', value)
will set a local variable, i.e. a variable which is not accessible outside of the current inline_script item. To create global variables, which can be logged and accessed from anywhere, use
self.experiment.set('var_name', value)