Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Test battery (automatically run multiple experiments consecutively)

edited April 2014 in OpenSesame

Hi
I have created several taakes in different opensesame files i want to run them for every subject as a sequence without the need to open each file after every task ank without the need to enter subject number several times.
How can it be done?
Dror

Comments

  • edited 12:35AM

    Hi Dror,

    You could create a batch file with which you call OpenSesame Run several times. Open a new text document (e.g. by opening Notepad), paste the following code in it, and save the document. After saving, change the document's extension from .txt to .bat. This makes it into an executable file, which will run the script (DOS commands, run via Command Prompt).

    title running multiple experiments!
    
    SET /P snr=Subject number: 
    
    "C:\Program Files (x86)\OpenSesame\opensesamerun.exe" PATH_TO_EXP_DIR\experiment1.opensesame.tar.gz --subject=%snr% --logfile=PATH_TO_EXP_DIR/exp1-sub%snr%.csv --fullscreen
    
    "C:\Program Files (x86)\OpenSesame\opensesamerun.exe" PATH_TO_EXP_DIR\experiment3.opensesame.tar.gz --subject=%snr% --logfile=PATH_TO_EXP_DIR/exp2-sub%snr%.csv --fullscreen
    
    "C:\Program Files (x86)\OpenSesame\opensesamerun.exe" PATH_TO_EXP_DIR\experiment3.opensesame.tar.gz --subject=%snr% --logfile=PATH_TO_EXP_DIR/exp3-sub%snr%.csv --fullscreen
    
    pause
    

    Change PATH_TO_EXP_DIR to the path to the relevant experiment directory. And change the path to your installation of OpenSesame, if that is different from my example.

    Please note that I do not have a Windows machine nearby, so the code is untested... But if any error occurs, please do report back!

    Good luck!

    Edwin

  • edited 12:35AM

    hi
    works like a charm!
    but... is there a way to do the same thing from inside opensesame exp?, I want to counter balance and control the order of appearance of every task
    Dror

  • edited 12:35AM

    Awesome!

    I'm afraid there is no way to do this from within OpenSesame's GUI, other than adding together ALL of your experiments into one giant experiment. Which would probably not be the best idea ever.

    What you could do is create multiple batch files, each containing a different order of tasks.

  • edited September 9

    @Edwin & @drorgarbi

    (& @sebastiaan you might be interested in this too)

    I found a plugin that did exactly this : https://github.com/dev-jam/opensesame_plugin_-_experiment_manager

    I downloaded it and then paster the "experiment_manager" folder into the plugin folder of OpenSesame. I launched the example file that is included and create an opensesame experiment including two other tasks.

    You can see the example with the debug window that shows the experiment has run without any problems ! (NB : you have to run the experiment in windowed mode but the experiments included will be launched in fullscreen nonetheless!)

    What do you think ? Nice huh ? 😁

  • Hey, that's Bob Rosbag's GitHub handle! I know the guy, and he's honestly great. Lovely to see that his stuff is helping you!

  • Yeah, his script works great !

    The only issue I encountered was the fact that the scripts run by this plugin would save the log file in the pool instead of the directory of the main script.

    So I had to do some "hacking" to solve it. Now it works great : all my log files (6 different tasks run in sequence thanks to Bob's plugin) are saved in the same folder. [If you want to know how, just tell me]

    This allows me to completely automate my experience. Yipeee

Sign In or Register to comment.