Here are the sample scripts that ship with character studio 4.
-- A script to input a .csm file
-- A script to output a .csm file
-- This script assumes that you have set up a .max file containing a biped or bone structure with a set of markers linked to the skeleton.
-- The markers you want to record should be contained in a Selection Set titled "markers"
-- The script will output the data at every frame for the entire animation range.