Probably a repost, but I noticed there are static addresses that return the current action bar slots spell id.
Starts at 0x0129BBA8 (action bar 1, spell 1)
Counting in + 0x4 goes along 1234567890-=
Once you reach 0x0129BBD8 this will list spells from the second action bar, and so on till you have gone through all.
Just thought I would share.