Millisecond Forums

Subject id from .txt file

https://forums.millisecond.com/Topic3910.aspx

By peppo - 2/16/2010

Hi everyone,


I'm trying to string together different experiments (authorware and inquisit), with inquisit coming last. I want inquisit to use an id number that was specified earlier in the experiment.


I've tried to use authorware to start inquisit with an id number like this:


"C:\.......\script.exe 22"


but this way every participant in inquisit gets the same number. I can't get the subject id variable between the "" in authorware..


Perhaps it is possible to start inquisit with a subject id read from a text file? That way I could have authorware create a .txt with the subject id, and have inquisit read that file..


Any help would be greatly appreciated! :)


Cheers,


Peppo.


By Dave - 2/16/2010

Authorware should be able to append a variable (i.e. the id collected earlier) to a batch call. I'd try something like


JumpOut("C:\Program Files\Millisecond Software\Inquisit 3\Inquisit.exe", "C:\Experiments\MyExperiment.exp"; VariableNameToPass)


where 'VariableNameToPass' is the variable that holds the participant ID collected earlier.


If this doesn't work, I'd create a simple Windows text file containing the following line


"C:\Program Files\Millisecond Software\Inquisit 3\Inquisit.exe" "C:\Experiments\MyExperiment.exp" %1


and save it as 'startexp.bat' in the same direcory as the Authorware file. Then the first command would simplify to


JumpOut(FileLocation^"\\startexp.bat"; VariableNameToPass)


Some useful links:



Once you've worked out a solution, please post it here. Others will appreciate it.


~Dave

By peppo - 2/17/2010

Hi Dave,


thanks for the reply! :D I used the .bat to get it to work! :)


I almost figured it out myself, except that I used this:


JumpOut("\\startexp.bat"; VariableNameToPass)


Which didn't work, now I've just used the following (difference is in the two backslashes, which Is stupid anyway :p):


JumpOut("startexp.bat"; VariableNameToPass)


(the .bat is in the same directory..)


Thanks a lot!


Cheers, Peppo



so, a recap on the solution for future readers:



  • create a .bat file (using notepad) which contains the program and script, and %1, like so:

    • "C:\Program Files\Millisecond Software\Inquisit 3\Inquisit.exe" "C:\Experiments\MyExperiment.exp" %1



  • Save this as startexp.bat and use this to start your inquisit experiment in authorware (or other software for that matter..)

  • Save the subject id in a variable (in this example: VariableNameToPass)

  • line to start in authorware:

    • JumpOut(FileLocation^"\\startexp.bat"; VariableNameToPass)




By Dave - 2/17/2010

Great! And thanks for posting a detailed outline of your solution -- I'm sure other users will find this very helpful.


Best wishes from a fellow Inquisit user,


~Dave