» Mon Sep 12, 2011 3:07 am
You can look it up directly from the xml.
The current breath left is stored in "breath_progress\breath_progress_ribbon\user1", so you can read its value with:
set breathLeft to GetMenuFloatValue "breath_progress\breath_progress_ribbon\user1" 1045
...which will give you a value from 0 (no breath left) to 100 (full breath). Note that the value doesn't update to 100 when above water, it only becomes 100 again as soon as you dive underwater.