[Chrome Extension] AI2Helper - download all blocks seperately and remove all orphan blocks with one click

can't we download individual blocks (method, property) from extension?

function downloadPNGIgnoreOrphan(){
			var topblocks=Blockly.getMainWorkspace().getTopBlocks();
			var blocks=topblocks.filter((block)=>{
				return types.indexOf(block.type)>=0
			});
			if(confirm("Are you sure to download all " + blocks.length + " blocks?")){

				var i=0;
				var timer=setTimeout(function(){
					if(i<blocks.length){
						exportBlockAsPng(blocks[i]);
						i++;
						timer=setTimeout(arguments.callee,1000)
					}
				},1000);
			}
		}

change
return types.indexOf(block.type)>=0
to
return types.indexOf(block.type)>=-1

this should be working, not tested.

2 Likes

It worked, thanks @Kevinkun!

today i start ai2helper with this problem
error ai2helper
try donwgrade script, other proyects, nothing works.
the list of methods/var/etc stills displays in one line.
if i copy paste that line to notepad, is all there, also if i click every letter of the line point to a block.

try from another computer, same issue

mayby it's because of this new updates of AI2 server. Will check tomorrow.

1 Like

App Inventor 2 block helper-0.7.7 (1).user.txt (11.6 KB)
checkout this modifications, it fix the problem and add some features.

2 Likes

i become too much addicted to your script. Thanks!

Thanks for the update.
I got it loaded and it works, but do I need both the old and new?

nono, only one.

Thanks for fixing the problem.

1 Like

updated v 0.7.8

  1. fixe the bug for showing outline as 'iiiiii';
  2. remove the function of "palletes scroll seperately", since it's buggy and this is a native function in Neo interface.

how to install this web extension?

Is it possible to make one for Kodular also?

Why? You just told us you are going to use only App Inventor.

Sorry, no plan to make this for Kodular, since I have problem to access Kodular creator.

1 Like

If someone's app broken like me it is very helpful to them. That's why i asked. :smile:

Hi and thanks for your extension. Unfortunately, after performing a search, all blocks are automatically Arranged Vertically! How can we avoid this behaviour and maintain original block layout? Thanks again

Not possible for now.

At first I found this to be a problem, then I had to reopen an old project where I forgot about this mental concept map and the reorganization that made this feature a great tool. I suggest you get used to it and depend more on looking for the functions in the list.

if you don't like the cleanup function, you can comment this line:

Blockly.getMainWorkspace().cleanUp()

at here:

Snipaste_2024-09-04_09-35-30