Thread: Radial Menu
View Single Post
Old 01-19-2017, 10:35 AM   #6
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
Default

Quote:
Originally Posted by Lokasenna View Post
The API function I'm using doesn't work with scripts. I'll look, but I don't think there's a different function that would.
The textual command IDs must be converted with NamedCommandLookup before they can be used with Main_OnCommand:

Code:
local userinput = "_RSf9af5a881a603f63b4ac8574e6736996fc85eaf5"
-- local userinput = 1234

local runtime_id = reaper.NamedCommandLookup(userinput)
if runtime_id > 0 then -- if the script/action is loaded
  reaper.Main_OnCommand(runtime_id, 0)
end
(The support for running scripts using Main_OnCommand was added in v5.12)
cfillion is offline   Reply With Quote