Could a script find hidden blocks?

Is there a way for a Snap! script to find hidden blocks?

untitled script pic-13 doesn't find them.

Why would I want a script to find hidden blocks anyway? Why don't I just look them up myself, using the "Hide blocks" function from the IDE's File menu?
The thing is, sometimes I write a simple yet powerful custom block that proves handy on many occasions. But I may be working on something new, and can't remember in which project I left the custom block, and since it's a simple one I rewrite it, perhaps with a twist. Later on I merge parts of projects, and multiple versions of what's more or less the same function turn up in my new project. I don't like clutter, so I want to standardize on one version. But before I can thow away the other version(-s) I want to make sure they're not used anymore, even by hidden blocks that may even be local to another sprite within the project.
I would like to automate all of this, because like I wrote, it happens to me more than once.
I found out how to make a script identify dependent blocks from other sprites, but how to make it find hidden blocks is still an enigma to me.

Use the reporter primitive block and set the option to ide_blocks. This searches for every single block that can be used on this sprite, no matter if it's hidden or not. It works for me.


yes, and that block is the "official" way to search all blocks, i.e. that's exactly its purpose, not a bug :slight_smile:

Works for me, too - thx!

I had understood that primitive blocks are not guaranteed to be continued in future releases. But for now I'm happy with it!

the "primitive" blocks will be renamed to "extension" in v10, and new "primitive" blocks will be introduced. But this is just a renaming scheme and will not break anything. In general we don't encourage direct usage of extension and primitive blocks outside of libraries for pedagogical reasons, but both should be reasonably (future-) safe to use.

Uh oh, does that mean I'm supposed to document them?

This here is my code. It's (much) more complicated than I like, but at least it works now,

with: selected programming tools script pic 2

naw, not really. I mean, this very discussion is not something I want to ever encourage learners to think about. The fraction of the Snap! community that's active in this forum and this thread is is so not my target group.

awe :(