Read from sd file into variable

folks, I cannot find any indication how an HMI script would read bytes from file and store into variable(s). Does it makes sense it only can put byte over serial communication? Would I need to short-circuit UART’s TX to RX to get hold of some bytes from file on micro SD card?
hoping anyone found the magic trick to accomplish this.