Hi Steven, its not necessary to prompt for the month number. Hope this helps.
<HAScript name="test" description="test" timeout="60000" pausetime="300" promptall="true" blockinput="false" author="sabine.rein" creationdate="30.08.2025" supressclearevents="false" usevars="true" ignorepauseforenhancedtn="true" delayifnotenhancedtn="0" ignorepausetimeforenhancedtn="true" continueontimeout="false">
<!-- import necessary java classes for working with dates and formatting -->
<import>
<type class="java.util.Date" name="Date"/>
<type class="java.util.Calendar" name="Calendar"/>
<type class="java.text.SimpleDateFormat" name="SimpleDateFormat"/>
</import>
<!-- define variables -->
<vars>
<!-- Variable to hold the current date -->
<create name="$currentDate$" type="Date" value="" />
<!-- Variable for calendar operations -->
<create name="$cal$" type="Calendar" />
<!-- Formatter for date formatting -->
<create name="$formatter$" type="SimpleDateFormat" value="" />
<!-- Variable to hold the month number as a string -->
<create name="$monthNumber$" type="string" value="" />
</vars>
<!-- First screen: Start -->
<!-- This is the entry screen where date calculation and formatting are performed -->
<screen name="Start" entryscreen="true" >
<description>
</description>
<actions>
<!-- 1. Create current date -->
<varupdate name="$currentDate$" value="$new Date()$" />
<!-- 2. Create a Calendar instance and set it to the current date -->
<varupdate name="$cal$" value="$Calendar.getInstance()$" />
<perform value="$cal.setTime($currentDate$)$" />
<!-- 3. Add 0 months (this line could be adjusted to move to a future or past month) -->
<perform value="$cal.add(2, 0)$" />
<!-- 4. Create a formatter to extract the month in "MM" format (e.G. 08 for August)-->
<varupdate name="$formatter$" value="$new SimpleDateFormat('MM')$" />
<!-- 5. Apply formatter to calendar date and store result in $monthNumber$ -->
<varupdate name="$monthNumber$" value="$formatter.format($cal.getTime()$)$" />
<!-- 6. Enter the formatted month number into the screen at row 4, column 19 / ADJUST ROW & COLUMNS NUMBERS ACCORDINGLY FOR YOUR SCRIPT-->
<input value="$monthNumber$" row="4" col="19" movecursor="false" xlatehostkeys="true" encrypted="false" />
</actions>
<nextscreens >
<!-- Define next screen flow -->
<nextscreen name="Ende" />
</nextscreens>
</screen>
<!-- Final screen: Ende -->
<screen name="Ende" exitscreen="true" >
<description>
</description>
<actions>
<!-- Output the calculated month number to the system log (see terminal / windows settings) -->
<trace type="SYSOUT" value="$monthNumber$" />
<!-- Or Output the calculated month number via messagebox-->
<message title="'Month Number'" value="'The calculated month number is: ' + $monthNumber$" />
</actions>
<nextscreens >
</nextscreens>
</screen>
</HAScript>
------------------------------
Sabine Rein
------------------------------