PsyScriptIcon.png PsyScript: getting experiments done

$query\n"; } $result = mysql_query($database, $query, $connection) or die("ack! query failed: " ."
  • errorno=".mysql_errno() ."
  • error=".mysql_error() ."
  • query=".$query ); return $result; } $Base = "http://www.maccs.mq.edu.au"; $URL= $PHP_SELF; $connection = mysql_connect('localhost', 'tim', 'connect2'); if (!$connection) { print("Cannot connect to database. Call Tim.
    "); exit(); } $result=safe_db_query("Counters","SELECT * FROM Count WHERE Base='$Base' AND URL='$URL'", $connection); while ($row = mysql_fetch_row($result)) { $ChkBase=$row[0]; $ChkURL=$row[1]; $ChkCount=$row[2]; $Count=$ChkCount; } if ($ChkURL == ""){ safe_db_query("Counters","INSERT INTO Count VALUES ('$Base','$URL','0')", $connection); $Count=0; } $Count++; safe_db_query("Counters","UPDATE Count SET Number='$Count' WHERE Base='$Base' AND URL='$URL'"); $result=safe_db_query("Counters","SELECT * FROM Count WHERE Base='$Base' AND URL='$URL'", $connection); while ($row = mysql_fetch_row($result)) { $Base=$row[0]; $URL=$row[1]; $Count=$row[2]; } echo $Count; */ ?>hits
  • Authoring Aid

    Purpose

    The authoring aid allows you to use the PsyScript library functions by simply selecting them from a dialog box. The aid then formats them and inserts them into your script.

    Installation

    Download the appropriate scripts, place the "authoring aid" script into either the "User Scripts" folder (for Smile) or the "Scripts" folder (script debugger)

    Usage

    In Script Debugger, pressing cmd-option-H should run the authoring aid.

    In Smile, use cmd-shift-A to activate the authoring aid.

    Running authoring aid produces a dialog with four options:

    File handling contains most of the contents of helper.lib.

    The list functions of helper.lib are in "manipulate lists".

    Screen contains functions to create and move rectangles and points on screen.

    Other is miscellany, and eye link is helpers for the eyelink pupil tracker.

    Which ever option you choose, you are then presented with a list of functions for that option. This next figure shows the handlers for the file handling option (with several function selected) (see figure on right)

    You can select multiple handlers (as shown) by holding down the shift- or cmd- keys.

    When you press "OK", the authoring aid will insert all of the selected handlers into your current script window. If needed, the code to activate PsyScript and load the needed libraries will be inserted for you.

    If there is no script window, one will be created for you, incliding code to load the libraryies - so this is a quick way to starta whole new experiment.

    Below, you can see the script that would result from pressing Ok from the dialog on the right, with now current experiment script window open:

    tell application "PsyScript"
       
    activate
       
    begin experiment
       
    set helper to load script file ("" & Psyscript base folder & "libraries:file.lib")
       
    set screen to load script file ("" & Psyscript base folder & "libraries:screen.lib")
       
    tell helper
          
    getLibraryVersion()
          
    initialize()
          
    setSubjectFileParameters({prefix:"", suffix:""})
          
    createNewSubjectID()
          
    readSpreadsheet(theFile)
       
    end tell
       
    end experiment
    end tell

    MACCS PsyScriptIcon.png Documentation Downloads FAQ Mailing List
    Last change:
    Advanced Search

    Applescript in a Nutshell : A Desktop Quick Reference

    AppleScript for Applications: Visual QuickStart Guide

    AppleScript For Dummies

    Applescript for the Internet Visual Quickstart Guide

    Applescript Language Guide; English Dialect

    Danny Goodman's Applescript Handbook