Hello,
I've found a way for opening and closing a patch but not to check if it's already open. How to do it?
thanks!
```
Check if a patch is already open
Hello,
I've found a way for opening and closing a patch but not to check if it's already open. How to do it?
thanks!
```
@tabache I think you will have to include a [receive X] in loopXgroove_test.pd, that when banged returns the bang through [send Y].......... and if you don't get the bang back then you know it isn't open.
I don't know of another way.
You could use the bang coming back to send your "close patch" message if you wish....... or to block the "open patch" message with a [spigot]..
David.
@whale-av thank you for the answer! nice solution !
Anyway, I hope for an easiest solution without inserting send/receive in abstractions
@tabache A possible solution would be to use [window_name] from the hcs library.
A nonexistant window returns .x0 while if it exists it returns the OS name for the window...... something like..... .x489f2e0....... look inside [pd get by canvas receive symbol] in the help file.
Returned as a symbol so a [sel .x0] will give you 1 of 2 bangs on its outlets depending on window existance.
Not sure how that would work with -nogui or without a window manager.
David.
Oops! Looks like something went wrong!