My computer has a headphone extension, when plugged in it swaps the sound to the headphone jack and silences the speakers.
Basically, is it possible to have the speakers be silenced and have the computer swap to the headphone jack only when the extension actually has plugged in at the end? Basically act like the headphone extension is a extension to the actual sound port
No sorry it does not work like that.
Essentially the jack socket in your computer has a switch built into it so that when you plug a jack plug into the socket it breaks the circuit to the speakers and makes one to the headphones.
Its a hardware switch built into the socket so no software will work.
See this ; http/
C is ground
D and E are headphone connections and sound in
F and G are the speaker connections.
When you plug the jack in it makes contact with D and E and pushes those contacts away from the F and G connections and so breaks contact with the speakers.
This is all analog so no software can alter it.