How to determine if a template is used in a project?

I'm working on some projects that are replacing older ones. They have inherited many parts of these older projects, including some templates that are going unused.

I would like to determine which templates are not used anywhere within a project, so that I can delete them, preventing further confusion and excess storage.

I don't seem to be able to accomplish this with the Edit/Find and Replace tool, nor by the action menu of the templates themselves.

If anyone knows a way to accomplish this please do let me know, thanks!

1 Like

This is an awesome question. In the find/replace tool, I haven't been able to get the search all windows option to work. It only works with windows that are opened.

To further complicate things, with templates, there's no easy way to know if they exist as a stand alone component in a window, or if they are being rendered by a template repeater or a template canvas. Furthermore, templates can also be nested in other templates.

I don't imagine there will be simple solution to this.

Consider using a script module to collect template startup events (propertyChange on componentRunning on the template's root container) in a module-level cache, and when new ones arrive, report them to the gateway. Where a global usage cache could be kept.

2 Likes

Basically the same question was asked here w.r.t Perspective:

And the answer is much the same. Collect usage statistics "manually" (see Phil's advice) if you want a well informed guess at whether something is truly used.