Enumerating plug-ins

  • So far, I found that enumerating installed plug-ins is possible but involves assumptions and caveats. First of all, enumerating is only possible by ID, as it is not possible to know in advance the names!


    1) Assumption: as far as I can tell, plug-in ID's are always sequential, i.e. in increasing order and without 'holes'. Can this be documented and 'cast in stone'?


    2) Caveat: ID's do not necessarily start at 0; if "reloadplugins" has been used (and possibly under other circumstances too), plug-in ID's may start with any integer. This requires a first loop to find the first ID and a second loop to iterate on the ID.


    As said above, it is possible to do it; it would be nice however if the process could be streamlined somewhat, for instance by providing a Plugin.getAllPlugins() method returning an array (or ListArray or whatever) of all installed plug-ins.


    Thanks!

  • 1) Assumption: as far as I can tell, plug-in ID's are always sequential, i.e. in increasing order and without 'holes'. Can this be documented and 'cast in stone'?

    Yes, that's basically true. Unless an unexpected error occurs when loading a plugin, there shouldn't be any "holes".


    if "reloadplugins" has been used (and possibly under other circumstances too), plug-in ID's may start with any integer

    That's also true. There is an internal counter which does not get reset to 0 when reloading the plugins. So if 10 plugins are loading (using id 0 to 9), and you use the "reloadplugins" command, the first plugin will have id 10, the 2nd plugin id 11 etc.


    it would be nice however if the process could be streamlined somewhat, for instance by providing a Plugin.getAllPlugins() method returning an array (or ListArray or whatever) of all installed plug-ins.

    Yes, that makes sense. This method will be added with the next update ;)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!