Can I run the cord for plugged ceiling lights through the attic?
Short answer: No, you can't run flexible cord through the ceiling/walls.

There are many problems with this, the main being that it's against code, relevant section:


  NEC 400.8 Uses Not Permitted
  
  (ref. Extension Cord) Flexible cords and cables shall not be used for the following: 
  
  
  As a substitute for the fixed wiring of a structure 
  Where run through holes in walls, structural ceilings, suspended ceilings, dropped ceilings, or floors
  Where concealed by walls, floors, or ceilings or located above suspended or dropped ceilings 
  


Essentially, you can use flexible cord from the junction box to the light itself (NEC 400.7, ref Pendants), but not past that point where it becomes part of the "fixed wiring of a structure".  The main reason (as I understand) for this is that flexible cord is more subject to physical damage (which can then lead to overheating). 



You have a few options. 

Suspend the lights

You can suspend the lamp from the ceiling using hooks or some other physical means, so long as the flexible cord is exposed (eg: no holes through drywall).

 

Use surface-mount conduit

There are various surface-mount conduits (or raceways) products that will allow you to partially conceal the wires. Some products can be painted.



Add a junction box

Bottom line, if you want the wire totally concealed, you need a junction box. This is a non-trivial task, and almost certainly involves punching holes in the drywall (which you'll have to patch afterwards) to be able to fish wires. You'd use solid-core wire to comply with code to run to the junction box (typically 14/2 romex). 

How to actually do this warrants an entirely new question. 

Anyway, once you have a junction box in the ceiling, the best thing is to get a type of lamp designed to be hard-wired.




I looked around for a retrofit box cover to use the existing lights as hardwired, but can't find one. I'm not sure such a thing exists, but if it does, you could use that to use the existing lights as hardwired lights. Even in this case, the wire to the junction box has to meet code (eg, you can't use flexible cord), although it would be fine, as per NEC 400.7(1) to use flexible cord from the junction to the light fixture itself.