I was able to replicate your issue, and think the problem is LocalSubmit
, which initiates a new subkernel (which may be your intention). If you switch to SessionSubmit
, you should be ok.
startTime = TimeObject[{18, 20, 0}];
endTime = TimeObject[{18, 22, 0}];
sessionStart = DateObject[Today, startTime];
sessionEnd = DateObject[Today, endTime];
obj = SessionSubmit[ScheduledTask[DateString[], {sessionStart, Quantity[1, "Minutes"], sessionEnd}],
HandlerFunctions -> <|"ResultReceived" -> Print|>,
HandlerFunctionsKeys -> "EvaluationResult"]

I'm guessing LocalSubmit
needs specific HandlerFunctions
and/or HandlerFunctionsKeys
to work properly, or perhaps some other kernel initialization.
Update: I've been able to get LocalSubmit
work in the manner you expected. I added an end to the timespec, but it also works without it.
obj = LocalSubmit[
ScheduledTask[
DateObject[], {Now, Quantity[1, "Minutes"],
Now + Quantity[2, "Minutes"]}],
HandlerFunctions -> <|"ResultReceived" -> Print|>,
HandlerFunctionsKeys -> "EvaluationResult"
]
