Using the %ICUDateTime%HH:mm% Token I am setting a time stamp for when a macro runs for each user. When it launches again I want to make sure the macro runs for the oldest time stamp to prevent the macro from running for multiples users at one time to prevent my pc from running too many macros (yes, it happens, I run other macros too, this one can wait for each person and running one at a time is fine).
How can I have a list of %ICUDateTime%HH:mm% varialbes with random times and select the one that is the oldest out of lets say a list of 10.
Just for fun – here's how I'd do that with AppleScript:
--------------------------------------------------------
# dNam: Christopher Stone <scriptmeister@thestoneforge.com>
# dMod: 2021/05/22 19:15
# Task: Extract the lastest time from a list.
--------------------------------------------------------
set timeList to paragraphs of text 2 thru -2 of "
12:45
11:13
11:45
23:22
23:21
11:58
12:23
11:01
"
set highTime to date (item 1 of timeList)
repeat with i in rest of timeList
set tempTime to date (contents of i)
if tempTime > highTime then
set highTime to tempTime
end if
end repeat
return text 1 thru -4 of time string of highTime
--------------------------------------------------------