Script Examples

 

Example 1

 

The following script sets the default folder, opens NEW.AVI, sets the number of points to 3 and then turns on autotracking.

 

folder( 'e:\video' )

open( 'new.avi' )

npoints( 3 )

name( point, 1, Hip )

name( point, 2, Knee )

name( point, 3, Ankle )

digitize( 1, 1, 0, 1 )

 

Example 2

 

This example records 3 seconds of data (15 frames at 5 Hz) from the Intel PC Camera and then displays the Save As dialog box.

 

new( 1 )

camera( 'Intel PC Camera PRO' )

resolution( 320, 240 )

framerate( 5 )

preview( 1 )

nframes( 15 )

record( 1 )

save( '' )

close()

 

Example 3

 

This example show how to use the repeat command and the repeat substitute variable.  The first file opens a second script file (name.mqs)  to open a series of files to rename the point names.  The repeat command will display a dialog box asking for the repeat count.

 

! Main script

folder( 'e:\video' )

repeat( -1, 1, open( e:\video\name.mqs ) )

 

! Script NAME.MQS

open( 'walk_%r.mqf' )

ifnot( fileopen, abort() )

msgbox( 'Renaming points in Walk_%r', 3 )

name( point, 1, 'Hip' )

name( point, 2, 'Knee' )

name( point, 3, 'Ankle' )

 

Example 4

 

This example show how to use the commands as HyperScript.  The commands are simply html hyperlinks that theWiz widget will send to MaxTRAQ.

 

<a href="MaxTRAQ:open( '' )">Open a file</a>

<br><br>

<a href="MaxTRAQ:save( '' )">Save File</a>

<br><br>

<a href="MaxTRAQ:close()">Close Current File</a>