Skip to main content

Rename screens in MIT App Inventor 2 (.aia) projects

Project description

ai2-screen-renamer

A command-line tool to rename screens in MIT App Inventor 2 projects (.aia files).

App Inventor does not provide a built-in way to rename screens. This tool automates the process by editing the .aia file directly, updating all internal references consistently.

What it does

For a given screen rename (OldNameNewName), the tool updates:

  • OldName.scmNewName.scm (Designer components file)
  • OldName.bkyNewName.bky (Blocks file)
  • $Name field inside the .scm file
  • main= and lastopened= entries in youngandroidproject/project.properties
  • Any open another screen block references in other screens' .bky files

Installation

Requires Python 3.10+.

pipx install ai2-screen-renamer

Or with pip:

pip install ai2-screen-renamer

Or install from source:

git clone https://github.com/fgimenez/ai2-screen-renamer.git
cd ai2-screen-renamer
pip install -e .

Usage

# Rename Screen2 to AgendaContactos, output to MyApp_AgendaContactos.aia
ai2-screen-renamer MyApp.aia Screen2 AgendaContactos

# Specify output file explicitly
ai2-screen-renamer MyApp.aia Screen2 AgendaContactos MyApp_renamed.aia

Or as a Python module:

python -m ai2_renamer MyApp.aia Screen2 AgendaContactos

Limitations

Screen1 cannot be renamed. App Inventor requires Screen1 to exist as the launch screen — renaming it would produce a project that fails to build.

Errors

The tool raises a descriptive error if:

  • The input file is not a valid .aia file
  • The screen to rename does not exist in the project
  • A screen with the new name already exists in the project
  • The screen to rename is Screen1

Development

pip install -e ".[dev]"
pytest -v

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai2_screen_renamer-0.3.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai2_screen_renamer-0.3.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ai2_screen_renamer-0.3.1.tar.gz.

File metadata

  • Download URL: ai2_screen_renamer-0.3.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai2_screen_renamer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 bcbd29f851eb7c177f752679132589d0575622d1c4b6a653c534f0b8738322af
MD5 95a8e2de5a0a5bd80f0d0f0c6cb63c0d
BLAKE2b-256 e3ea759c59cdb2e3f580fcff098d09ae432b0192adaf2ff66d2b93e05caff0a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2_screen_renamer-0.3.1.tar.gz:

Publisher: publish.yml on fgimenez/ai2-screen-renamer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai2_screen_renamer-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai2_screen_renamer-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eeaebe6d96c2efe87b3170cbdade28ad93ef8c525b73d46946dbc5e8fc804954
MD5 5a4f2a09ef8c35005478bf8bfb9c3f5a
BLAKE2b-256 fe27ac2d34a026b4f9047efa24d97195f1ba6bdddc9253405823987d34b508ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2_screen_renamer-0.3.1-py3-none-any.whl:

Publisher: publish.yml on fgimenez/ai2-screen-renamer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page