You just add your code inside the loop, after the copy line. You can use ScriptListener to record playing an action and then just put in new names of the actions if there are more than one, like:
for(var i=0;i<theFiles.length;i++){
theFiles[i].copy('~/desktop/' + docName); //or whatever path you want
playMyAction(actionName,actionSet)
}
function playMyAction(name,set){ //subsitute name & set for names of action and set used to record action
//ScriptListener code here to play action....
}