Backpack: Copy and Paste Blocks to Different Screens and Projects
The Backpack allows you to carry around blocks throughout your project repositories, allowing blocks to be transferred between projects and between screens. The contents of the Backpack are persistent across logins. When you login to MIT App Inventor, you will find the blocks you left from your last session.
Click here for a video demo.
The Backpack is a copy-and-paste feature that works between projects and screens. The Backpack icon is located at the upper-right corner of the workspace.
Copying Blocks. Blocks from the workspace can be dragged and dropped into Backpack. This is the copy operation -- the blocks are copied (duplicated) in the backpack. When blocks are dropped into the Backpack, an animation and sound will occur to confirm for the user that the operation was successful. The blocks are not removed from the workspace.
Viewing the Backpack Contents. The contents of the Backpack can be viewed by clicking on its icon (upper right corner of the workspace). A scrollable flyout will pull out from the right edge of the workspace, displaying the Backpack’s contents. The flyout of the Backpack works the same way as the flyouts in the Block drawers.
To close the flyout without pasting any blocks, you can click the workspace or click any empty space in the Backpack with no block highlighted. Note that if you click on a highlighted block in the flyout, that block will be pasted to the workspace.
Pasting Blocks. Blocks can be pasted from the backpack into the current workspace by clicking on the Backpack icon (upper right corner of the workspace) and dragging the block from the flyout to the desired location in the workspace.
In addition to the drag-and-drop functionality, you can select Backpack functions by right-clicking on a block or on the workspace, as shown in the following image.
[right click on a block] [right click on the workspace]
Initializations that duplicate existing blocks in the destination workspace will be automatically renamed. For example, if you try to paste a variable initialization block for global variable X and the workspace already contains an initialization block for X, the variable will be renamed X2 in the pasted block.
Similarly, if you try to paste a procedure definition for procedure foo and the workspace already contains a definition of foo, the pasted procedure will be renamed foo2.
Can you paste blocks into any project or screen?
Yes. However, there are instances when pasting blocks from the Backpack to a new project or screen will cause red error triangles to appear. For example, this will occur when a block refers to a non-existent variable or procedure in the destination project. The errors can be removed (fixed) by defining the missing variable or procedure. It will also occur when a block refers to a non-existent component in the destination project. The errors can be removed (fixed) by adding the missing component and giving it the same name as the one referred to in the pasted block.
Can blocks be removed from the Backpack?
To remove all blocks from the Backpack, right-click on the workspace, and select "Empty the Backpack". There is currently no way to remove only some of the blocks.