To keep a selected carriage position during the opening/closing operation of a carriage and to restore the state before the opening/closing operation.
This mechanism is composed of the carriages 1-3 whose opening/ closing operation is enabled in the case of being selected, a linked cam 20 for which cams 21-23 for selecting a desired carriage are attached on one rotary shaft 27, recessed parts 26 on the carriages 1-3 to/from which the cams 21-23 can be engaged and disengaged, a first gear 31 on the rotary shaft 27, a second gear 32 engaged with the first gear 31, a swing arm 33 for rotating the second gear 32, a cam gear 50 for swinging the swing arm 33 by a carriage selection cam 53, a first selected position keeping means 41 for changing the position corresponding to the rotation of the linked cam 20 and a second selected position keeping means 42 to be engaged with the first selected position keeping means 41 at the time of the opening/closing operation of the selected carriage for controlling the rotation of the linked cam 20 and restoring the first selected position keeping means 41 to the position before the opening/closing operation while keeping the selected position of the carriage.