View Single Post
Old 02-04-2019, 02:52 PM  
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,575
Default

I've reduced it to the following steps and minimal scripts:
  1. Run Script A.lua:
    Code:
    function loop() reaper.defer(loop) end
    loop()
  2. Run Script B.lua (with the correct command ID for Script A.lua):
    Code:
    reaper.defer(function()
      local cmd = reaper.NamedCommandLookup("command ID of script A here")
      reaper.Main_OnCommand(cmd, 0)
    end)
  3. Select "Terminate instances"

Maybe you could message the main script to terminate itself using a temporary extstate instead of re-running it?

Last edited by cfillion; 02-04-2019 at 03:40 PM.
cfillion is online now   Reply With Quote