"$Grn " vs. "grain"

I was looking through some older batchPlay code that I thought was generated by Alchemist (though not entirely sure) and came across some code that used "$Grn " to designate green. This seemed odd relative to the designation for the other colors. The example below is for making a Black and White adjustment layer.

//Make Black and White adjustment layer
{
   "_obj": "make",
   "_target": [
      {
         "_ref": "adjustmentLayer"
      }
   ],
   "using": {
      "_obj": "adjustmentLayer",
      "type": {
         "_obj": "blackAndWhite",
         "presetKind": {
            "_enum": "presetKindType",
            "_value": "presetKindDefault"
         },
         "red": 40,
         "yellow": 60,
         "$Grn ": 40,
         "cyan": 60,
         "blue": 20,
         "magenta": 80,
         "useTint": false,
         "tintColor": {
            "_obj": "RGBColor",
            "red": 225.00045776367188,
            "grain": 211.00067138671875,
            "blue": 179.00115966796875
         }
      }
   },
   "_isCommand": true
}; 

I checked Alchemist yesterday for the code and now get the following where "$Grn " has been replaced by "grain", which actually makes more sense.

//Make Black and White adjustment layer
{
   "_obj": "make",
   "_target": [
      {
         "_ref": "adjustmentLayer"
      }
   ],
   "using": {
      "_obj": "adjustmentLayer",
      "type": {
         "_obj": "blackAndWhite",
         "presetKind": {
            "_enum": "presetKindType",
            "_value": "presetKindDefault"
         },
         "red": 40,
         "yellow": 60,
         "grain": 40,
         "cyan": 60,
         "blue": 20,
         "magenta": 80,
         "useTint": false,
         "tintColor": {
            "_obj": "RGBColor",
            "red": 225.00045776367188,
            "grain": 211.00067138671875,
            "blue": 179.00115966796875
         }
      }
   },
   "_isCommand": true
}

It seems like both "$Grn " and "grain" work, but I wonder if one is more correct and should be used, especially given that $Grn " is unusual compared to the other color designations. I wonder where the "$Grn " name actually came from. It seems to be an outlier.

Here’s a nice explanation from @simonhenke

They both have exactly the same typeID number. Alchemist for conversion from .ATN file into batchplay uses this alchemist/CharIDToStringID.ts at master · jardicc/alchemist · GitHub

Otherwise, you could have much more strings like that and it would be more confusing. I think these might be preferable in .ATN files because are shorter and save space.

Thanks for that info @Jarda & @Karmalakas . If they have the same typeID, then it’s my understanding they should work equally well for triggering the correct response in Photoshop.