Input: pink gear making two green screws rotate in the same direction. Threads of the screws have opposite helical directions.
Violet lever carrying two half nuts contacts with one of the two screws. The contact is controlled by a toggle mechanism of pink lever, blue spring and two blue stoppers.
Output: yellow slider having linear reciprocating motion. Its length and position can be adjusted by setting positions of the two blue stoppers.
Thread form must be square in order not to cause radial force that tends to push the nuts from the screws.
In case two green screws rotate in opposite directions, threads of the screws have the same helical direction.
Created only on computer, this mechanism needs to be verified in practice.