altering the print screen into a function

unable to figure out why it will not call the function as needed, could
use some help.