View Single Post
Old 08-12-2019, 08:56 AM   #3
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 506
Default

Yes you are right, this does work. I'm not sure why I couldn't get it to work, maybe I was using it in the wrong way.



Here's a working example for anyone who stumbles upon this later.

Code:
  local initprj = reaper.EnumProjects(-1,"") -- get initial tab project
  local t={}
  local p=0
  local i = 1
  while p do  -- add projects to table
    p,fn=reaper.EnumProjects(i,"")
    t[i] = p
    i=i+1 
  end 
  
  reaper.SelectProjectInstance(t[#t]) -- sel last project in table
  reaper.Main_OnCommand(40860,1) -- close project
  reaper.SelectProjectInstance(initprj) -- sel initial project tab
Travesty is offline   Reply With Quote