How did “cutting a dido” originate?

This phrase means to play the mischief, to cut up, to cut capers. In some sections of the United States dance a dido is used instead of cut a dido. Dido as applied to a caper, trick, antic or extravagant action is an Americanism of unknown origin, haying thus far baffled all etymological research. Efforts have been made to establish some relationship between it and the cunning trick used by Queen Dido of Carthage to get a handsome “hide” of land. According to the legend, Queen Dido and her followers, upon arriving on the coast of Africa, asked of the natives only so much land as they could enclose with a bull’s hide. When this was freely granted, Dido caused the hide to be ‘cut into strips and with these strips she enclosed a spot on which she built a citadel around which the city of Carthage grew up. But there is little suppose that the colloquial American phrase has any connection with this mythological story.