Script for Open /Close Plugin Editor


I have this idea from the very beginning of using GP, and for nowadays this helps knowing more about scripts.
I can open OR close with a widget, but how to do it with the same widget? ON/OFF

OpenPlugin : Open the plugin editor
Declaration: function OpenPlugin (p : Block) autotype
Category: Plugins
p : Block

ClosePlugin : Close the plugin editor
Declaration: function ClosePlugin (p : Block) autotype
Category: Plugins
p : Block


Test newValue and call open or close depending on the result


Oh its closer; but not enough, sorry

    NormalStateButton : Widget
    Dexed : Block
    On WidgetValueChange(newValue : double) from NormalStateButton


If newValue > 0.5
then openplugin…
Else closeplugin…



Yeah!! even with my musician coat on… getting the hang of it :wink:
Thanks for help @david
Brace yourself for some crazy open/closing plugin window editors!!

    Dexed : PluginBlock
    OpenCloseButton : Widget

   On WidgetValueChanged(newValue : double) from OpenCloseButton
   If newValue > 0.5
    then OpenPlugin(Dexed)
    Else ClosePlugin(Dexed)


Is this script working now?
I was looking for a quick way to access the Plug-in Editor without having to go into Edit mode.
I tried entering the script but it showed an error, would be great if it works.
Does the Widget have to be assigned to the plug-in with no parameter selected for it to work?


What error are you getting?


Hi Daved, thanks for the quick reply.

The error message reads:

“Syntax Error: Line 4, Col 4: Unexpected or unrecognized token: ‘WidgetValueChange’
Mismatched input ‘WidgetValueChange’ expecting {Activate, Deactivate, Variation, TimerTick, TimePassing, NoteOnEvent, NoteOffEvent, NoteEvent, ControlChangeEvent, PitchBendEvent, AftertouchEvent, ProgramChangeEvent, PolytouchEvent, MidiEvent, ParameterValueChanged, WidgetValueChanged, OSCMessageReceived}”

I am new to GP and have not had time to study the Scripting language but this ‘Open Plugin Editor’ feature would be a great help to me right now.
Initially, I copied and pasted the Script into the Script Editor but have just tried typing it in and still get the same error.
Your help would be appreciated.




just add a - d - WidgetValueChanged
(instead of WidgetValueChange)

Script language evolved…


@keyman I edited your script above to reflect that change to the keyword.


Many thanks @david, (I tried but could not…)


I haven’t had a chance to look at permissioning for posts to see if there’s a way to allow a poster to modify his/her own post


Thanks for the replies everyone.
I am now getting the following error:
“Semantic error: Line 2, Col 13: Declarations of this type are not allowed”
Line 2 reads: Dexed : Block


Yeah, that got changed a long time ago as well






Thank you David, that worked to a degree. The Script compiled successfully but reported that the Plugin was now found so I see that the Word “Dexed” refers to the Plugin.
How do I find the correct name for the Plugin I wish to address?

Sorry for the questions, I am going to read and learn the programming manual just a soon as I’ve finished digesting all of the GP User Manaul.


This is indeed documented in the language manual

Right click on a block and there’s an option to set its name and enable OSC and/or GP Script support. Whatever name you define there should be the same as the declaration you use in the script


Thanks again, almost there but where do I find the Plugin Block to right click on?

Ah … Just seen the light. Found the Block, didn’t realize that’s what they were called.


That’s brilliant, all working now and making life much easier. Even learned some scripting along the way with reference to the manual.

Thanks for the help guys.