Some standard toslink cables come with the adapter to fit the headphone output. Mine did. It's just a small piece of plastic that looks like a headphone jack on one end and accepts the toslink on the other.
iMac Combo Headphone/Optical Out Port Cable
I just picked up a used Apple G5 iMac (2005 model) that has a combination analog/optical digital audio output port. The output on the iMac is a mini plug. I want to use it to digitally connect to a Panasonic receiver and I can use either an optical Toslink and S/DIF RCAs input. I can't find a cable that does what I want. Anybody know how to connect this setup?