View Single Post
Old 02-22-2019, 02:15 PM   #6
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

As mentioned, you'll have to select the project.

Since project is selected I used the normal commands and it works here,..

Code:
function DisarmAllProjects()
  for p = 0, 1000 do
    local proj = reaper.EnumProjects(p, 0)
    if not proj then
      break
    else
      reaper.SelectProjectInstance(proj)
      reaper.Main_OnCommand(40491, 0) -- Track: Unarm all tracks for recording 
      reaper.Main_OnCommand(1007, 0) -- Transport: Play 
    end
  end
end
If you need to restore the originally selected project tab look in ReaPack, theres a few scripts to save and restore selected tab.

EDIT Saving and restoring proj tab seems simple enough,....
Code:
function DisarmAllProjects()
  -- save  current selected proj tab
  local cur_proj = reaper.EnumProjects(-1, 0)
   
  for p = 0, 1000 do
    local proj = reaper.EnumProjects(p, 0)
    if not proj then
      break
    else
      reaper.SelectProjectInstance(proj)
      reaper.Main_OnCommand(40491, 0) -- Track: Unarm all tracks for recording 
      reaper.Main_OnCommand(1007, 0) -- Transport: Play 
    end
  end
  
  -- restore original selected proj tab
  if cur_proj then reaper.SelectProjectInstance(cur_proj) end
end

Last edited by Edgemeal; 02-22-2019 at 03:01 PM.
Edgemeal is offline   Reply With Quote