Sending entire .script to robot via Primary Client Interface

Using the Primary client interface (TCP/IP socket communication on Port 30001), can you send an entire .script file to the robot at once rather than sending one command at a time via Python? If so, how?

You could probably get the information you are looking for by checking @jbm github project called Script Communicator

Yes, you can send several lines of script, you just have to surround them with def nomatterwhatyourprogramnameis(): and end

Example :

def primaryProgram():
  while (True):
    movej([0.9434381127910002, -1.3082063255028469, 2.2063341418137945, -2.6507188134210273, -1.081363649387086, 4.80585136204575], a=1.3962634015954636, v=1.0471975511965976)
    movej([0.9433155477260482, -1.014172108307441, 2.246293286726412, -2.9852336083709154, -1.0813798520591593, 4.805802742045307], a=1.3962634015954636, v=1.0471975511965976)