Is it possible to create a plugin that installs a new routine template, visible from the menu “Insert routine”->(new)->“New routine”?
I don’t think you actually need a plugin. PsychoPy pulls all the routine “templates” from a folder in the app called “Resources/routine_templates”. The templates themselves are just XML files. If you go to that folder, there’s a README that tells you a little more about it, though looking at it, the file paths might be out of date:
Routine templates
These will show up as options that can be added to Experiments using New Routine in
either the Flow of the Experiment menu.You can add Routine Templates of your own by adding an experiment file to your PsychoPy
preferences folder, typically:
- ~/.psychopy3/routine_templates # on MacOS
- AppData\Roaming\psychopy3\routine_templates # on Win10The name of the experiment file becomes the name of the Category and the name of the
Routine within that file becomes the name of the template.Have fun making those wacky, reusable templates!
I don’t know if a plugin would work for this because they’re meant to modify Python code, not change the contents of resources folders and such. You might be better off just creating the new template and dumping it into that folder manually.
That folder doesn’t exist by default, but I have just confirmed that it works. I’ll make it today’s tip.