I made the script by Xpyriment and Pygaze, and copied it into the inline_script of Opensesame (3.1.6) on MacPC.

On the other hand, it runs partway of program on another version of Opensesame (3.0.7). In this case, the experiment runs correctly by the end of first block. From the second block of experiment, the procedure becomes wrong (e.g., the fixation mark becomes a black box, the stimuli are presented in the blank screen which doesn't have any stimuli originally...)

I have attached my program. Note that some codes are omitted for the clear understanding.

Thanks in advance!

Comments

It looks like you are trying to create a folder, while your user has no write permissions (I'm assuming you are on a unix like system. Mac, right?). Just create a folder called 'data' if that's where your log will be saved (I didn't see this in your script).
I ran it on a win 10 and got this:

Traceback:
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 102, in run
self.experiment.python_workspace._exec(self.crun)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\python_workspace.py", line 161, in _exec
exec(bytecode, self._globals)
File "<string>", line 24, in <module>
NameError: name 'listAll' is not defined

'listAll' is not defined in your script (maybe it is in the omitted part).

It shows the same error even though I created the 'data' folder in Contents\Resources. In Opensesame ver 3.1, there is no data folder in Contents\Resources while there is in ver 3.0. That's why I created the data folder in the location.

I think you need a data folder in folder where your experiment file is located. (I didn't find any data folder on windows machine.) The line 169 and 170 from _files.py check if the path where you are running from is a directory and creates one (perhaps temporarily, not sure)
if not os.path.isdir(directory):
os.mkdir(directory)

Where are you running the experiment from? Try putting the experiment file in a folder, say on desktop, and run from there.

I just tested on a mac. I don't have any data folder in Contents\Resources, and got the same error about listAll
NameError: name 'listAll' is not defined
I think you have permissions error as I said earlier.

It still has shown the same error even though I created the data folder where the experiment file is and also had permissions by sudo open /Applications/OpenSesame.app (https://support.apple.com/en-us/HT204012).
In the case of permission, I cannot start OpenSesame in the first place.

As I mentioned, this error hasn't occurred on the another Opensesame version (3.0) while there is the different error.