I’m not sure why you’re getting mixed results but I’m posting code below that works for me. To select a ZSphere, turn on Move mode (W on keyboard) before clicking the ZSphere you want, otherwise you’ll keep adding ZSpheres. Also, you can wrap the [ZSphereEdit] command around a whole bunch of code - simpler than repeating it the whole time.
[IButton,GetInfo,
[If,[ZSphereEdit,0],
[VarSet,currentZS,[ZSphereGet,8]]
[Note,[StrMerge,"
Current ZSphere index : “,[Val,currentZS],”
"],-1]//index
[ZSphereEdit,
[Note,[StrMerge,"xPos : “,[ZSphereGet,1,currentZS],”
"],-1]//xPos float
[Note,[StrMerge,"yPos : “,[ZSphereGet,2,currentZS],”
"],-1]//yPos float
[Note,[StrMerge,"zPos : “,[ZSphereGet,3,currentZS],”
"],-1]//zPos float
[Note,[StrMerge,"radius : “,[ZSphereGet,4,currentZS],”
"],-1]//radius float
[Note,[StrMerge,"color : “,[ZSphereGet,5,currentZS],”
"],-1]//color 0-16777215 long int
[Note,[StrMerge,"mask : “,[ZSphereGet,6,currentZS],”
"],-1]//mask 0-255 int
[Note,[StrMerge,"parent index : “,[ZSphereGet,7,currentZS],”
"],-1]//parent index short int
[Note,[StrMerge,"time stamp : “,[ZSphereGet,9,currentZS],”
"],-1]//time stamp short int
[Note,[StrMerge,"childs count : “,[ZSphereGet,10,currentZS],”
"],-1]//childs count short int
[Note,[StrMerge,"child index : “,[ZSphereGet,11,currentZS],”
"],-1]//child index short int
[Note,[StrMerge,"time stamp count : “,[ZSphereGet,12,currentZS],”
"],-1]//time stamp count short int
[Note,[StrMerge,"time stamp index : “,[ZSphereGet,13,currentZS],”
"],-1]//time stamp index short int
[Note,[StrMerge,"flags : “,[ZSphereGet,14,currentZS],”
"],-1]//flags int
[Note,[StrMerge,"twist angle : “,[ZSphereGet,15,currentZS],”
"],-1]//twist angle float
[Note,[StrMerge,"membrane : “,[ZSphereGet,16,currentZS],”
"],-1]//membrane int
[Note,[StrMerge,"X res : “,[ZSphereGet,17,currentZS],”
"],-1]//X res int
[Note,[StrMerge,"Y res : “,[ZSphereGet,18,currentZS],”
"],-1]//Y res int
[Note,[StrMerge,"Z res : “,[ZSphereGet,19,currentZS],”
"],-1]//Z res int
,0]
[Note,0]
]
]
Edit: your code is returning the correct values. For example, rotate one of the ZSpheres and you will see the Twist Angle change.