I recently installed 2 pocket door kits together from one room to an adjacent in my house. The building inspector said he saw no problem with me installing a light switch in a shallow electrical box on the pocket door frame as long as I could properly secure the wire per code, within 8" of the box. The frame is 3/4" thick and 14/2 wiring is a little over 3/8" wide.
In the image below, how do I secure the wiring which runs to the switch (just 1 wire) to the edge of the frame? Has anyone come across this before? What can I do to make sure it doesn't come loose and start rattling against the door?
Obviously the purpose is to keep the light switch to the room as close to the entrance as comfortable. In fact I may move the switch down one stud to make room for molding, In either case the question is the same.
The wiring will come in just above the frame and below the header in this picture below, and then run down the metal stud to the switch box.