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

The old way of downloading the PNG with the code should also stay. I want the SVG images for other things.

With SVGs you get high quality images of the blocks that you can size as big as you want. You aren't limited to the size of the generated png's. If you scale a bitmap you get less image quality.

Those svg images can be used on a lot of media for example on posters/tutorials/t-shirts :grin:

Below an example of a Scratch image generated by the Chrome extension I showed.

In short I see a purpose outside of App Inventor not inside :wink:

3 Likes

did you imported the css files in your html:

http://your ai2server url/static/css/blockly.css
http://your ai2server url/static/css/ai2blockly.css

When you could get the SVG you could make images like these. You could seal them so you could write on them. You could tell about the different properties or let students write them down on it while working on a project together without using the computer.

This is how they look in Inkscape and in Brave. The scratch ones work without a problem. Only the green flag or the dropdown widget is made into a bunch of bad pixels but i can replace them.

They are also using the font from Scratch being Helvetica Neue. I don't know if that is the font of App Inventor to.

I was also wondering how many unnecessary data is send when generating the blocks. The bevel edges are not really needed and a remnant from earlier versions of the App Inventor blocks.

This is how it looks when pulled apart in Inkscape

We would just need one block instead of three.

By the way the Scratch extension is also working without a problem with this editor.

My guess is that the extension is making certain assumptions about the particularly Blockly version. Scratch blocks were created on a newer version of Blockly than App Inventor currently uses, so my guess is that it is failing to grab all of the necessary style dependencies to produce the right SVG. I do have a tool to generate all of the blocks from a given extension, which is used to provide the images in the IOT website e.g., the BluetootheLE docs where the images are actually SVG. That's done using nodejs, so a similar technique should work in the browser.

4 Likes

The block is not exporting correctly because newer version of blockly change the CSS injunction (currently we are not able to get CSS style using javascript blockly API) so now we have to select element form DOM and then copy the CSS content of the element.

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