Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kkclstuff

macrumors 6502
Original poster
Apr 18, 2015
312
206
NYC
hi Ive been trying to script a "count down of days" so I receive a spoken [notification each day till deadline]

I created an "Until" shortcut that I can add into other shortcuts as needed. BUT the scripting isn't right. I see the 'count and 'calculation' scripts with variables and magic variables containing dates and format for "How long ago/until" but Im not thinking thru the logic properly. ah HELP please!! LOL can anyone help me correct the workflow?

Goal: to countdown from 90days from "creation" date (either 1. the day I created the shortcut, 2. the day input as text not script) or
Having the script 'look at' an event and 'countdown the days left' would be perfect, but not sure how to script that either.

I know I can get apps and widgets from App Store, but I'd prefer to 'script it' as an addition within Shortcuts instead of adding apps, alarms, events, or reminders to phone.
Thanks!

IMG_0200.jpg
 

kkclstuff

macrumors 6502
Original poster
Apr 18, 2015
312
206
NYC
Thanks Jessica!! I get stuck looking in that "scripting" TAB and forget to use the search bar LOL

I just found this Shortcut "updated-countdown" that I can also take apart for my use too.

the "get time between" is perfect. I made this... (but still don't understand how "the creation date" works; im guessing its for cal events only, and not when the the script is made)
IMG_0201.png
 
Last edited:

kkclstuff

macrumors 6502
Original poster
Apr 18, 2015
312
206
NYC
is there a way/place to 'see' ALL of the scripting options categorized? That scripting TAB is like a 'best of' list ...far from complete.
 

kkclstuff

macrumors 6502
Original poster
Apr 18, 2015
312
206
NYC
Now... is there a way to make this "Until" Shortcut remove itself from within other Shortcuts once the counter hits zero? :cool:
 

kkclstuff

macrumors 6502
Original poster
Apr 18, 2015
312
206
NYC
Thanks Jessica for the idea.

For those playing along...heres the resulting "Countdown to day" Shortcut with 'IF script' for either >0, 0, or neither (-1) result:

fullsizeoutput_283.jpeg

fullsizeoutput_282.jpeg

fullsizeoutput_281.jpeg
 
  • Like
Reactions: Jessica Lares

Jessica Lares

macrumors G3
Oct 31, 2009
9,612
1,057
Near Dallas, Texas, USA
Hello. I have a field in a database “due-date” and another one “days-remaining”, I would like to auto-calculate the days remaining based on today's date on page load or once every 1 or 10 min while a user is using the app. I’m sure it's an easy solution but can’t seem to figure it out. Thanks
Hi, this was a question specifically about doing this in a iOS app called Shortcuts. This sounds like you're doing something web related. You might get an answer over at the Web Design and Development section, but this might be a too Apple/Mac centric place for your question and you need to find a place specifically for whatever database system and language/frameworks you're using.

 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.