Reading out motion sensor

Does anybody know how to read out the motion sensors in a Macbook…?
==» using a (shell) script …?

You might find some help here Eelco: The Apple Motion Sensor As A Human Interface Device by Amit Singh.

Thanks Adam,

Somehow I remember that page - but it’s updated.
Thanks for pointing out…!

However, I installed AMStracker (http://www.kernelthread.com/software/ams/ams.html)
and I can call ./AMSTracker which returns the x,y,z values in a string like
“-9, -1, 30”

However, I am unable to convert “-9” into a number yet…

I get a list of characters like so:

set AMS to paragraph 2 of (do shell script "/Users/adambell/Desktop/SuddenMotion/AMSTracker/AMSTracker") as Unicode text
set C to text items of AMS --> "  -3    0   43"

And from there, I’d find contiguous minus signs and/or numbers and convert those to integer. (haven’t done it).