I have a very simple script which I would like to run from the Apple Watch (Series 6). I created a shortcut which calls the Scriptable script but what I get is “Run Script”, I touch run and it just ends. I would like it to speak the result without any extra intervention. I know there are easier ways to do this without scriptable but I’m just trying to get a handle on how to get anything to work on the watch. I would also like it to show the results as text but when I tried to use the alert function that didn’t work on the watch either.
Here is the script:
var today = new Date(); var dd = String(today.getDate()).padStart(2, '0'); var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0! var yyyy = today.getFullYear(); today = mm + '/' + dd + '/' + yyyy; var date1 = new Date('06/11/2020'); var date2 = new Date(today) var Difference_In_Time = date2.getTime() - date1.getTime(); // To calculate the no. of days since Alan was born: var Difference_In_Days = Math.round(Difference_In_Time / (1000 * 3600 * 24)); Difference_In_Days + " days old.” Speech.speak("Alan is " + Difference_In_Days + " days old."); Script.complete()