Quote:
Originally Posted by semikid
Does this belong in the script requests?
|
Probably. There's 3 contexts. Envelope is the other one. What action should it do when Envelope has focus?
Here's an example.
Code:
-- Do action based on context example.lua
gcc = reaper.GetCursorContext2(true)
if gcc == 0 then
reaper.Main_OnCommand(40281,0)-- Track: Solo/unsolo tracks
elseif gcc == 1 then
reaper.Main_OnCommand(40759,0)-- Item: Split items at edit cursor (select right)
elseif gcc == 2 then
reaper.Main_OnCommand(42087,0)-- Envelope: Split automation items
end
function NoUndo() end
reaper.defer(NoUndo)
You can change the number after Main_OnCommand. Right click the action in the Action List. To use an SWS action or script, NamedCommandLookup is needed, to get that number which varies between different Reapers. A string of characters appears in the Action List instead of the number. Example:
Code:
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELNEXTTRACK"),0)-- Xenakios/SWS: Select next tracks
stuff which follows
-- is non functional as code, on that line. A "comment".