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