View Single Post
Old 04-03-2018, 10:22 PM   #202
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by NextLevel View Post
Regarding your script 'mpl_Set_custom parameter of custom fx to custom value.lua'. I was wondering if you could mod it to toggle between two custom values?
You need to store some external data when running script (I mean state of your switch), SetProjExtState() should does the job for you. Or you can take as a reference X-Raym template (because it is a toggle it is limited to only 2 states though). Put at main() something like
Code:
is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
state = reaper.GetToggleCommandStateEx( sec, cmd )
if state == 1 then 
  -- (code for apply some value)
 else
  -- (code for apply another value) 
end
mpl is offline   Reply With Quote