-- TERMINATE INSTANCES !!!
-- TERMINATE INSTANCES !!!
-- TERMINATE INSTANCES !!!
local function SetToggleButtonOnOff(numb);
local value,ScriptWay,sec,cmd,mod,res,val = reaper.get_action_context();
reaper.SetToggleCommandState( sec, cmd, numb or 0);
reaper.RefreshToolbar2( sec, cmd );
end
local function loop();
local Mouse_State = reaper.JS_Mouse_GetState(127);
if Mouse_State&8 == 8 or Mouse_State&9 == 9 then;
local window,segment,details = reaper.BR_GetMouseCursorContext();
if window == 'arrange'then;
local Mouspos = reaper.BR_GetMouseCursorContext_Position();
local EditCur = reaper.GetCursorPosition();
if Mouspos >= 0 and Mouspos ~= EditCur then;
reaper.SetEditCurPos2(0,Mouspos,false,false);
end;
end;
end;
reaper.defer(loop);
end;
reaper.defer(loop);
SetToggleButtonOnOff(1);
reaper.atexit(SetToggleButtonOnOff);