Melt 1 tablespoon butter with the olive oil in a large skillet over medium-low heat. Add the onions and cook, stirring occasionally, until soft and caramelized, about 20 minutes. (For a shortcut, use onion marmalade in place of the caramelized onions.)
Lay out 4 slices of bread. Top with half the cheese, then half the ham. Layer the caramelized onions, apple slices and the remaining ham and cheese on top, then the remaining bread slices.
Wipe out the skillet; melt 1 tablespoon butter over medium-low heat. Add 2 sandwiches and cook, pressing gently with a spatula, until the bottom is golden and the cheese begins to melt, about 4 minutes.
Flip and cook until golden, about 4 more minutes. Repeat with the remaining butter and sandwiches.