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
  • PsyScriptIcon.png PsyScript: getting experiments done

    $query\n"; } $result = mysql_db_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
  • System Requirements

    So, you are considering adopting PsyScript for your Research and have some questions? OK.
    PsyScript, will run on any PowerMac running OS 8.5 or better.
    What Screen is best?

    Any Mac monitor is fine - the faster the better. iMacs are great as they often run at 100Hz refresh rate. I cannot (yet) recommend any commercial LCD monitors for research work.

    What do I need to collect Key presses?

    USB keyboards will give you about 20msec resolution, as will USB mice.

    If you need millisecond timing, PsyScript fully supports your legacy BBOX gear, and now supports ActiveWire. To learn how to build and ActiveWire key box, read here.

    What about a voice key?

    If you have a pre-2001 Macintosh, the sound in port is excellent - just buy an Apple Microphone and you are in business

    If your Mac is USB sound-in only, I recommend the Griffin iMic (about $30).

    What about accurate timing?

    For more accurate timing, turn Virtual Memory off*. You should also run with minimal system extensions turned on**, and quit other programs running in the background***

    PsyScript is very good about not yielding time within scripts, so you can often ignore these requirements in many scripts you can ignore these needs. You can always check the timing on any trial by using timer logging.

    *Tip: turn off virtual memory using the memory control panel under the apple menu.

    ** Tip: use the extensions manager to switch to just the base extension set

    *** Tip: to turn off all other applications when you run a PsyScript experiment, use PsyScript's "Quit All Applications" menu item.

    quitall.gif

    back_f01.gif

    Resources

    In PsyScript, experiments are built using Apples' core scripting technology AppleScript. AppleScript and Apple's free Script Editor are both installed on every Mac

    AppleScript Documentation

    Apple has a web site devoted to AppleScript. Check it out. At this site, you can get an online manual for AppleScript (click here to go there now) and a pdf version you can get there or direct from this link. Apple seem to keep breaking this link: if it is down now, grab a copy from my hard drive

    Also available is interactive help on AppleScript

    Books

    You probably still want to buy a book on AppleScript. I recommend that you buy AppleScript for the Internet. If you can find a copy, The Tao of AppleScript is excellent. There is also a new book out by O'Rielly, but I have not yet read it. Also good is O'Rielly's new book.

    Online resources

    MacScripter.net collects together most of the web's knowledge about AppleScript.

    There are 3 mail-lists that you should join

    1. The PsyScript Mailing List. Click the link at the top of any page in this site to join from there.
    2. An open scripting discussion
    3. Apple's Scripting List

    The first one is where you get support from other PsyScript users. Feel free to post questions about AppleScript at either of the last two.

    Alternative Script Editors

    Script Editor is free with your Mac. However, I recommend that you buy a copy of Script Debugger from LateNight Software.

    Its makes debugging scripts much easier, supports drag and drop text editing, find and replace and is in all ways a superior product.

    Scripting Extensions

    Scripting Extensions or "scripting extensions ("OSAXen")" extend the AppleScript Language.

    Some jobs in PsyScript are a lot easier if you install these three: Akua, Acme, Tanaka. You can find more here.

    You install them by dropping them onto your closed System Folder (for autorouting) or else direct into the scripting additions folder inside your System Folder. The scripting extensions are not essential, but provide valuable functions for processing data. If you get into AppleScript, the power of some scripting extensions will knock you out.

    back_f01.gif
    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