Not a single line actually, but still pretty simple.
Just iterate through the event list, locate the event you’re going to modify, and use SetRunInAutomation to check or uncheck the Automation box. If there’s more than one event, you should give the particular event a unique description like “My Event” in the example below.
As always, it is a good idea to lock the list during the iteration so no other thread can modify it.
Also note that the event list is currently a property of the playlist, that is, each playlist has its own event list. This is likely to change in a future version of mAirList.
EventDescription = 'My Event';
for i := 0 to CurrentPlaylist.GetEventList.GetCount - 1 do
if CurrentPlaylist.GetEventList.GetItem(i).GetDescription = EventDescription then begin
// Item was found, update flags
SystemLog('RunInAutomation was disabled for ' + MyEvent);
SystemLog('Did not find the event ' + EventDescription);