When SFM isn't the answer, ComputerCraft is.
I don't know if that's still a thing in 1.7, but in 1.6, CC had a bunch of methods that could interract in very precise manners with inventory slots. IIRC, it was added by OpenPeripherals, but I'm not 100% sure.
EDIT: Yeah, it was deffinitelly...