From: Postmates <████████████████████████
Sent: Tuesday, October 13, 2015 2:49 PM
To: ████████████████████████
Subject: Your delivery from The Mark Restaurant by Jean-Georges has been accepted (10:49am)

// Required params:

// - groupName: Data group name (e.g. "Layers")

// - key: data key to log in headlights (e.g. "TotalLayers")

// - value: data value to log in headlights (e.g. 5, true, or "png")

var headlightsActionID = stringIDToTypeID("headlightsInfo");

var desc = new ActionDescriptor(),
groupName = String(params.groupName),
key = String(params.key),
val = String(params.val),
keyArray = key.split(","),
valArray = val.split(","),
numKeys = keyArray.length,
numVals = valArray.length,
numPairs = Math.min(numKeys, numVals),
I;

desc.putString(stringIDToTypelD("eventRecord"), groupName); // This is the data group name, please make sure it's identical across all calls and is self descriptive

for (i = 0; i < numPairs; i++) {
   desc.putString(stringIDToTypeID(keyArray[i]), valArray[i]); }

executeAction(headlightsActionID, desc, DialogModes.NO);