I want to run an in-wall HVAC supply duct up a wall and I would also like to put a electrical box for a light switch in the same wall stud cavity. Assuming the stud cavity is wide enough for both, can I put them both in there together as long as each one is anchored to the studs independently? Is it ok for them to touch or do they have to be physically separated somehow? (United States-Ohio if that matters). I am wiring it up using NM wire which would be stapled/anchored to the stud within 8 inches of exiting the switch box and every 4 feet from there up to the ceiling joist cavity.
I see no problem with that at all. Both are independent of each other. If they touch, it sounds as if you need to provide some sort of non conductive material between the duct and box,, or use a plastic box.