Re: delay 1 millisecond in Panther
Re: delay 1 millisecond in Panther
- Subject: Re: delay 1 millisecond in Panther
- From: Timothy Bates <email@hidden>
- Date: Sat, 14 Feb 2004 11:31:23 +1100
>
Cc: Christopher Nebel <email@hidden>, <email@hidden>
>
Subject: Re: delay 1 millisecond in Panther
>
Indeed, my friend needs tools to design a psychological experiment (if
>
possible, using Mac OS X). Briefly, display a cue word for several
>
milliseconds, then the cue word disappears for several millisecond;
>
afterward, the target word displays for several milliseconds and then
>
disappears. The aim is to measure the "priming effect" (correct term?).
We have a free app to do that and more
<www.maccs.mq.edu.au/~tim/psyscript/>
Currently under OS 9, but we have a beta running under X.
PsyScript synchs to the screen refresh, has great timing, and executes time
dependent code in its own interpreter.
Your friends experiment would be
tell application "PsyScript"
activate
begin experiment
set stimList to {{"prime", "target"}, {"prime2", "target2"}}
repeat with stimuli in stimList
do trial "!e + #500 ?1 #50 !e #150 ?2 !t" given stimuli
--!e == erase screen
--#n = wait n milliseconds (can do other kinds of wait, like "wait n
millisecs since last wait"
--?1 = the first argument given (and ?2 = the second)
--!t = start a reaction time clock
end repeat
set theResponse to {reaction time, subject response}
end experiment
end tell
display dialog "the last one took you " & item 1 of theResponse & " msecs"
A complete version with reading the stimuli from file and saving responses
to disk is
tell application "PsyScript"
activate
begin experiment
--load function libraries
set helper to load script file ("" & Psyscript base folder &
"libraries:file.lib")
--load stimuli
tell helper
checkVersion(2) --make sure the library file is recent
initialize() --set the path to the Resources folder.
createNewSubjectID() --ask for a unique subject ID to in which to
store data
end tell
set noticed of every key to true --make this false to ignore all but the
keys you want
tell key "Z"
set noticed to true
set mapping to "living"
end tell
tell key "/"
set noticed to true
set mapping to "dead"
end tell
set trialString to "!e + #500 ?1 #50 !e #150 ?2 !t"
--load your stimulus list from a tab delimited file of stimuli
set stimList to readSpreadsheet("filename") of helper --If you just give
the filename, the file must be in the default folder ("resources" along
side your script)
--or just include them here like this
set stimList to {{"prime", "target"}, {"prime2", "target2"}}
set trialNumber to 1
repeat with aStim in stimList --while not completed
do trial trialString given aStim
set theRT to reaction time
set theResp to subject response
tell helper to writespreadsheet(aStim, theResp, theRT)
end repeat
end experiment
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.