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

dontlan

macrumors regular
Original poster
Jan 9, 2024
122
9
I'm in need of a time stopper / runasdate for a particular application. I've searched internet for a bit but it is hard to find one. Anyone knows if there's one please?
 

bogdanw

macrumors 603
Mar 10, 2009
6,144
3,042
This one:
AppleScript:
--Get time setting for action to occur
set t to "3:16:30 PM"
--build a time string to use as a target.
set cd to (current date) as text
set AppleScript's text item delimiters to " "
set targetTime to text items 1 thru -3 of cd
set targetTime to date ((targetTime as text) & " " & t)

repeat while (current date) < targetTime
    beep
    delay 30 -- check the time every 30 seconds
end repeat

tell application "Mail"
    quit
end tell

Replace "3:16:30 PM" with the time you want your app to close and "Mail" with the name of the app you want to close.
 

dontlan

macrumors regular
Original poster
Jan 9, 2024
122
9
This one:
AppleScript:
--Get time setting for action to occur
set t to "3:16:30 PM"
--build a time string to use as a target.
set cd to (current date) as text
set AppleScript's text item delimiters to " "
set targetTime to text items 1 thru -3 of cd
set targetTime to date ((targetTime as text) & " " & t)

repeat while (current date) < targetTime
    beep
    delay 30 -- check the time every 30 seconds
end repeat

tell application "Mail"
    quit
end tell

Replace "3:16:30 PM" with the time you want your app to close and "Mail" with the name of the app you want to close.
I don't need to close the app, I need it to always work but the time in it stopped, is this possible?
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
6,302
5,021
Not quite understanding as well, but to add to above, Launch Agents are made for this type of task. But will admit, not as straightforward as an app to do that.

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