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+.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai2_screen_renamer-0.2.0.tar.gz
  • Upload date:
  • Size: 8.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 c65a82b9f871cbd06289085661734c80b81c10268ff648f1393726f370c54bc2
MD5 ef26466508436bd37db384923e66cb0f
BLAKE2b-256 ab8f6aae3726fabc3c31f3991f4aa8e6590132b9408752aefe4396b26ed8e2df

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai2_screen_renamer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41d582054a4f1e2c42dbaec190d10ca9cd409c292ddc09e03df6a3ecd7b78ead
MD5 416c956f09d444b833b65759f2ef526e
BLAKE2b-256 e3d19997006275e70298b270fc38e9eaf5c0ca14dfa5c8e55fdc87d08b1b3d56

See more details on using hashes here.

Provenance

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