In your code files1 is a list, not a file. That's why the Open() command probably fails. Try Open(files1) or similar (look in the manual!) to get a file name in the list instead of the whole list. That's the first problem I spotted. Might be more.
Btw, to get swift help it would help if you explain why your code didn't work (the log window is indeed helpful in this respect).
I had an i as the loop index in the open command so that worked. Here is the error I am getting the jmp log window. Send Expects Scriptable Object in access or evaluation of 'Send' , dt << Join( With( dt ), By Row Number )
Could it be that I cannot iteratively join the same table? dt changes every time the loop runs and it moves across all the files in the files1 list.
Following assumes folder contains only .jmp files. If other kinds of files or folders exist then you should remove all non .jmp files from the files list. you may or may not want to uncomment the Merge Same Name Columns line.