Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 08-08-2019, 05:58 AM   #1
Travesty
Human being with feelings
 
Travesty's Avatar
 
Join Date: Nov 2014
Posts: 506
Default reaper.SelectProjectInstance( proj ) seems to have no effect

I'm trying to select a project tab in LUA by passing a project to reaper.SelectProjectInstance( proj )

It seems to have no effect.

https://forum.cockos.com/showthread....03#post2167303
Travesty is offline   Reply With Quote
Old 08-09-2019, 07:08 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,438
Default

Assuming it is a valid project pointer that is not the active project, that ought to be working?

e.g.
Code:
p,fn=reaper.EnumProjects(1,"")
reaper.SelectProjectInstance(p)
Justin is offline   Reply With Quote
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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.