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 Screen1 to AgendaContactos, output to MyApp_AgendaContactos.aia
ai2-screen-renamer MyApp.aia Screen1 AgendaContactos

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

Or as a Python module:

python -m ai2_renamer MyApp.aia Screen1 AgendaContactos

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

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.0.tar.gz (8.5 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.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai2_screen_renamer-0.3.0.tar.gz
  • Upload date:
  • Size: 8.5 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.0.tar.gz
Algorithm Hash digest
SHA256 83f68773b3e2400849f6575b75cb842f3709f665e98376d7bcd1198a0ccb98ce
MD5 316d9f225e91bd7c15cd8912e07fdd3d
BLAKE2b-256 467373144252bfcec8bea7d86b8e9cc057b4842864d8f6ffe1c9edf7dea8f23e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2_screen_renamer-0.3.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai2_screen_renamer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21dc44dceeef888f69a4fb0211cd9fd0ba083333b07f13ce4594a3bf17dc8e36
MD5 aeb0240c13678fb6569c9fa3f0dcb558
BLAKE2b-256 04876f7be8f590578e31eb4c32773a7becf49f75c31878b9f6df2aa869940e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai2_screen_renamer-0.3.0-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