Syntax in Button Script for If PD is open, reopen

Iam using my pisound to help run a random gen midi and want to simply have it so the button push script checks if its already open, so if statement yes, close then reopen…

I don’t want to use the app, or do anything other than the button press…

Thank you for any insight…

Hey, the current button script does close all PD instances and relaunch the patch. This is achieved by executing killall puredata in this script.

Do you want to have more PD instances running that you started with other means and the button to only start and reopen the particular PD patch?

Thank you, i think this helped me figure out the problem lies in a library i’m using. in that case where in the logic of the script would i append zexy, I already have it in the button press which opens puredata initially… I need to open it on the reopen as well otherwise error!

What is the error you’re getting? You might have to add some [declare -stdpath …] object or something in your patch to make zexy library found.