I'm writing an extension that needs a screen name as a property. The control block "open another screen" shows the available screens in the designer.
Is there an option to get a similar behavior in an extension?
No, unfortunately, it is not currently possible for a standard App Inventor extension to have a property that automatically populates a dropdown list of screen names from the user's project.
TIMAI2
September 11, 2025, 8:41pm
3
You could have a look at the sources, see if that helps:
this.setColour(Blockly.CONTROL_CATEGORY_HUE);
this.appendValueInput('VALUE')
.appendField(Blockly.Msg.LANG_CONTROLS_EVAL_BUT_IGNORE_TITLE);
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(Blockly.Msg.LANG_CONTROLS_EVAL_BUT_IGNORE_TOOLTIP);
},
typeblock: [{translatedName: Blockly.Msg.LANG_CONTROLS_EVAL_BUT_IGNORE_TITLE}]
};
Blockly.Blocks['controls_openAnotherScreen'] = {
// Open another screen
category: 'Control',
helpUrl: Blockly.Msg.LANG_CONTROLS_OPEN_ANOTHER_SCREEN_HELPURL,
init: function () {
this.setColour(Blockly.CONTROL_CATEGORY_HUE);
this.appendValueInput('SCREEN')
.appendField(Blockly.Msg.LANG_CONTROLS_OPEN_ANOTHER_SCREEN_TITLE)
.appendField(Blockly.Msg.LANG_CONTROLS_OPEN_ANOTHER_SCREEN_INPUT_SCREENNAME)
.setAlign(Blockly.inputs.Align.RIGHT)
.setCheck(AI.BlockUtils.YailTypeToBlocklyType("text", AI.BlockUtils.INPUT));