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

Congratulations @Kevinkun!! Your extension is wonderful!! I had a lot of trouble when I needed to find blocks since the two apps I have built using App Inventor are quite large. It took me ages of panning and zooming in and out, and with your extension I can go directly where I want!

Thank you so much!!

3 Likes

You can also use the eighth note search:

  1. go to the three dots at the top right
  2. click on find and write the name of what you want to find.
    Unfortunately, it just does that, for everything else just follow the advice to download the extension. Hello
1 Like

Thanks again! Works as expected on Chrome. My browser is Firefox, I'll try that too.
What I find confusing is that it always says "Found one match", it would be nice
if it said "n of m" - but may be tricky to code...

I made another version of AI2 block helper:

This time we use tampermonkey.

HOW TO INSTALL

  1. go to tampermonkey, install the browser extension according to your browser.
  2. go to App Inventer 2 block helper (greasyfork.org), to install this userscript.
  3. open https://ai2.appinventer.mit.edu, open your project (if autoload is distabled), in about 10 seconds, you will see the buttons as below:
  4. done.
4 Likes

( greasyfork script/extension added to FAQ)

I made an update for this AI2HELPER, now it looks like this:
Snipaste_2023-12-30_20-49-08

Click the AI2HELPER button, it will show (or hide) a palette, you will see some buttons and a list of all the top blocks (global variables, procedures, and events) in alphabetical order.

Click on this list item, it will highlight the relavent blocks.

for how to use, click here

4 Likes

The Greasy Fork version has stopped working.

I am seeing disquieting things at that site.

@ABG Sorry I don't understand what you mean.
And I can not find the post which is saying greasy fork not work.

My apologies, the AI2Helper button moved to the center of the AI2 header bar from the far right, and I must have tunnel vision.

I was distracted trying to find out what the TamperMonkey icon was trying to tell me with that red 1.

The Greasy Fork site now looks less hacked than before.

1 Like

Blocks button on right side of screen gets cut off after update of AI2Helper script to v0.7.6
Running on chrome. Browser zoom at 100%

Another picture of Blocks button cut off
Designer button also cut off

I have reverted back to older version 0.7.2

Thanks for your report. please check with 0.7.7.
Now the helper will hide automaticly when switching to designer view.
If the screen is not wide enough, you need to use the horizontal scrollbar.

1 Like

Hi
I have tried the 0.7.7 version but I think I will stick to the old version 0.7.2

Anyway it is a real time saver in searching and locating blocks fast and easily.
Thank you for creating this script.

I am using version 0.7.7 and lose most of my controls bar after turning on the extension.


None of the AI2 scroll bars or dragging attempts work at exposing the Designer/Blocks Editor buttons once this happens.

Sample run

Sorry for the bad experience.
You can downgrade to 0.7.2.

but 0.7.7 is working on my computer very nice.
动画

The error happens when switching screens to screens with lots of blocks.

Reverting to 0.7.2 avoids the error.

1 Like

For some reason when I click on Download all as png after installing the extension, it says Are you sure you want to download 0 blocks? I have 13 blocks total.

But when I click OK it doesn't download.

only event, procedure, and variable definition to be downloaded.

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