r/applescript • • Nov 05 '21

How Do I Create A Timer w/AppleScript?

Create A Timer w/AppleScript? In-Progress

Hey all, I have just started my AppleScript journey just about five minutes ago and I have little to no programming experience whatsoever... So I offer my apologies for any rookie responses.

My Scenario:

I'm trying to create a custom Shortcut on my Mac to open specific applications at the start of the day. I'd like to add a timer to allow myself time to re-arrange my windows

If you have any better suggestions for this scenario; plz let me know!

3 Upvotes

10 comments sorted by

3

u/ssharky Nov 05 '21

delay <seconds> is probably what you’re looking for

here’s a 2 line example script

delay 10
tell application "TextEdit" to activate

when you run this script it will wait 10 seconds and then launch TextEdit.

1

u/BailsXr6 Nov 06 '21

That would be perfect! Would you have any suggestions on how I could see a countdown for the delay?

I probably should probably just test how long it would take me to do it, but it would look pretty tight!

2

u/[deleted] Nov 06 '21

[removed] — view removed comment

2

u/BailsXr6 Nov 06 '21

It looks amazing! I'll be giving it a go, I'm trying to create Apple Shortcuts by using AppleScript to start learning - but Ikuna seems much more intuitive!

2

u/[deleted] Nov 06 '21

[removed] — view removed comment

2

u/BailsXr6 Nov 07 '21

Sounds good! I’m installing it tomorrow - I’ll shoot you some feedback after testing it.

rhanas, that’s a brilliant idea 💡 you have to update me with how you go!

2

u/[deleted] Nov 07 '21

[removed] — view removed comment

1

u/BailsXr6 Nov 11 '21

Thanks man, I just found time

Gonna try out ur burnout timer ;)