View Single Post
Old 07-31-2011, 01:41 PM   #209
sws
Code Monkey
 
sws's Avatar
 
Join Date: Sep 2007
Location: Madison, WI
Posts: 857
Default

Quote:
Originally Posted by Fabian View Post
Does anyone know how I can read the state of toggles? I know I can toggle them (with Main_OnCommand(cmdID, flags)) but how do I know if I need to toggle or not?

Specifically, I want to toggle on the "Options: Selecting one grouped item selects group" (which is a toggle so it should be really be named as such), but if I toggle it (Main_OnCommand(41156,0)) and it is already on, it goes off...
Yes,
First, you need to find the variable name for the option you're toggling. Check reaper.ini to see what's changed before and after the toggle, perhaps clicking "save as default" in the project prefs dialog in between.

Then, check out this TokSeekMode example from the SWS codebase (many more toggle functions in there), referencing my utility funcion GetConfigVar. Hope this helps!
sws is offline   Reply With Quote