Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Thread Tools Display Modes
Old 09-16-2021, 09:07 AM   #1
Human being with feelings
Join Date: Aug 2021
Posts: 3
Default Exiting REAPER after python script in a function is called with a button

Hello all,
I have this GUI made with the Scythe module, very straight forward and useful tool for this purpose.
I got recently blocked at trying to exit Reaper by calling one function when the user clicks that Button.
local function launch_potion()
  local potion_path = "~/Documents/REAPER/extract_potion.py"
  local cmd = string.format("~/venv/bin/python3 %s", potion_path)
  --reaper.atexit(os.execute('~/venv/bin/python3 ~/Documents/REAPER/extract_potion.py'))
  --Scythe.quit = true


local window = GUI.createWindow({
    name = "SAUCE",
    w = 50,
    h = 50,

layer = GUI.createLayer({name = "Layer"})


    name = "launch_btn",
    type = "Button",
    x = 40,
    y = 40,
    w = 250,
    caption = "Launch Potion",
    func = launch_potion


So whenever the user click that `Launch Potion` Button, an external python script GUI is being launched, and my reaper GUI or even Reaper itself stay open unless I force quit from terminal or the usual force quit of MacOS.
I even tried including a `subprocess` in the py script calling `pkill REAPER` but no luck.
Not sure if that's even supported by Reaper.
I would appreciate it if someone can show me another way to do this please.
Thank you!

Last edited by gnai29; 09-16-2021 at 02:43 PM.
gnai29 is offline   Reply With Quote

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 04:44 AM.

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