For AlarmClockView to display a message box at a specific time, it needs a script that does the following:
To add the script:
messageDelay "Delay the message prompter. Subtract the present time from the user's alarm-time (alarm) to get the number of seconds to delay the Message prompt." | h m alarm seconds | h := ((self subpartNamed: 'Hour') entryString) asNumber * 3600. m := ((self subpartNamed: 'Minute') entryString) asNumber * 60. alarm := h + m. seconds := alarm - (Time now asSeconds). seconds < 0 ifTrue: [seconds := seconds + 86400]. [(Delay forSeconds: seconds) wait. (self subpartNamed: 'Message Prompter1') prompt] fork.
If Undefined or a similar phrase is shown, ensure that you've typed in the code given above.
You can copy code from this help to the clipboard by selecting Copy from the Edit menu of the browser window. Then paste it into the Script Editor by selecting Paste from the pop-up menu of the lower pane. (After you delete all text except for the script, pop up the menu and select Save.)
Changing the part names in the script
If you've not renamed the user-interface parts, you'll have to change the (self subpartNamed: '<part name>') <attribute or action> statements in the script. To change, for example, the one following h := :
h := ((self subpartNamed: '<name>') entryString) asNumber * 3600.
<name> should have whatever name is given for the Hour Data Entry part.
If you need to change the part names for the Minute Data Entrypart (statement following m :=) or the Message Prompter1 part (last line), you might check the Subparts pane of the Subpart Features Syntax tool to see what you named the parts. Then replace Minute and Message Prompter1 with your names for the parts. Save any changes that you make.
Click on the
icon to switch back to the Composition Editor.