Renaming screens

Procedures, global inits don't get copied.

Thank you for helping

This should work. Can you give an example of it not working?

Hi Evan - when you say it should work, how is meant to work? Menu, keyboard combo? I tried everything that you could relate to the Clipboard on a Windows OS PC but nothing at all happened in the Designer Workspace or the Component Tree.

Edit - tried copying the most obvious - buttons, labels, textboxes.

It works by hooking the HTML5 copy and paste events the browser emits when the OS-standard mechanisms for copy and paste are activated. I typically invoke it through Cmd+C and Cmd+V on macOS. Ctrl+C and Ctrl+V should work on Windows. Going through the Edit menus should also work.

I tested it with Firefox in a Windows 10 VM and it worked fine.

Select component (or Screen) Ctrl+C and Ctrl+V works for me in Windows 7 with Chrome.

...... But Ctrl C / Ctrl V copy paste the entire Component set by default? I tried them by selecting the component to copy, then paste. Did not work in FireFox. Tried it again just now and it did work!

....... I think this might be related to the import of other's Projects. I'm finding that most of the time, if I import someone else's Project, it has read only behaviour - If I save a copy, then I can modify. Anyhow, it works and it's going to be a great time saver!

You can do it easily using 7-zip or WinRar.
Just download AIA and open it.
Now navigate to src folder untile you see bky and scm files.
Rename specific bky and scm files.

There is much more to it than that, all internal references have to be changed too. However, nb184 can do it in the IDE:

  1. Create a new Screen with the name required;
  2. In the original Screen, Ctrl + C to copy the whole thing;
  3. Open the new Screen and Ctrl + V paste;
  4. If the original screen had Blocks other than those dedicated to Components, open the new Screen Blocks work area and delete all Blocks;
  5. Delete all Blocks in the BackPack;
  6. In the Original Screen, Blocks work area, copy all Blocks to the Backpack;
  7. Open the new Screen again, Blocks work area, paste all Blocks from the Backpack;
  8. Delete the original Screen.

Hmm. It sounds like the right thing to do here is if the Screen is the source of a copy operation to just serialize the whole blocks workspace (the Screen copy was a sort of hack I added onto the existing copy-paste work I had been doing) and use that instead of determining things by component. I'll have to think about the best way to implement that.

Note that you can skip the copy and paste of the blocks by pressing Ctrl+Shift+V (Cmd+Shift+V on macOS) instead.

Good to know :zebra:

I have done that multiple times in Kodular.
But maybe App Inventor is different.
So kindly tell me few of those references.

what about reading the complete answer?


The only internal reference that seems possible is of Screen blocks.

If you rename a screen, you also need to rename any places where you open that screen from other screens, so there's that. I'm not sure if that's what @ChrisWard was referring to or not.

Thank you @ewpatton :slight_smile:
But that should not be a problem because if anyone renames screen using that method then he can also change those references from blocks.

no, because else you might find for example a Screen1.Initialize block in Screen2


@BeksOmega is also making it so that there is a Screen reference block for use with the open another screen block as part of her GSOC project, so that may complicate things slightly in the future.

Ideally, it would be good if we could implement renaming a screen as part of the App Inventor UI rather than playing tricks with the AIA file.


@BeksOmega is also making it so that there is a Screen reference block for use with the open another screen block as part of her GSOC project, so that may complicate things slightly in the future.

Hmmm, this is definitely a tricky problem, but I don't think the new block will cause any problems that you wouldn't have with trying to update the equivalent text blocks. The screen blocks are pretty dumb hehe, they just look at a dynamic list which is held on the workspace, which gets updated by the DesignToolbar.

I'll say that if you don't want to try to update the relevant blocks when a screen is renamed (which would be really tricky) the blocks do fail pretty gracefully. If they have a selected value which is no longer available (eg deleted, renamed), they mark themselves as a badBlock() so that they're visible to the user.