Navigation stuff goes here


Concepts: blocks

What sort of thing can I put in a script ?

A PsyScript script is made up of blocks. There are four normal multi-line types of block plus two special single-line blocks which allow for easy commenting.

Types of block

The shortest PsyScript script

Every script needs one procedure block. The shortest possible legitimate PsyScript script is as follows:

define fileFormat PsyScript script format 2.0 define homeFolder file:///Users/simonslavin/Desktop define logMethod localStorage proc main end proc

Anything shorter than that isn't a proper script and won't run. Here's a script which features all the kinds of block:

define fileFormat PsyScript script format 2.0 define homeFolder file:///Users/simonslavin/Desktop define logMethod localStorage -- This whole script does nothing at all. -- But it does contain at least one of each kind of block. proc main -- these comments are indented because they're part of a procedure -- rather than being their own blocks end proc -- since this script does nothing, the table doesn't need to contain data table stimuli end table textblock introductoryText This is some text which can be accessed by the 'display text from …' command. end textblock comment about blocks This type of block is like a textblock but PsyScript ignores it completely. end comment

Technical notes

See also