So I'm trying to write a script that lets me convert a stereo item to mono using a script instead of the right click menu.
It works when when the item is clicked, but if the item is selected with the marquee tool or the current selected track is different from the track the item is on it doesn't work.
Here's the code:
function main()
reaper.Main_OnCommandEx(40894, 0, 0) -- Item: Explode multichannel audio or MIDI to new one-channel items
reaper.Main_OnCommandEx(40006, 0, 0) -- Item: Remove items
reaper.Main_OnCommandEx(41140, 0, 0) -- Item navigation: Select and move to item in next track without changing track selection
reaper.Main_OnCommandEx(40117, 0, 0) -- Options: Toggle trim content behind media items when editing
reaper.Main_OnCommandEx(41140, 0, 0) -- Item navigation: Select and move to item in next track without changing track selection
reaper.Main_OnCommandEx(40006, 0, 0) -- Item: Remove items
reaper.Main_OnCommandEx(40285, 0, 0) -- Track: Go to next track
reaper.Main_OnCommandEx(40287, 0, 0) -- Track: Go to next track (leaving other tracks selected)
reaper.Main_OnCommandEx(40288, 0, 0) -- Track: Go to previous track (leaving other tracks selected)
reaper.Main_OnCommandEx(40005, 0, 0) -- Track: Remove tracks
end
main()
Any help is appreciated, Thanks