A device for selectively picking up and depositing articles, destined to an automatic warehouse comprising: a support plane for the temporary support of an article; a temporary support for the temporary support of a tray that is intended to contain a pre-determined number of articles; a manipulator (4,5), which is so structured as to grasp and release an article and to translate the article between the support plane and the temporary support; wherein the manipulator (4,5) comprises a first pickup element and a second pickup element, which are movable independently of each other along a transverse direction; characterized in that it comprises a control module that regulates and controls the operation of the manipulator (4,5) for picking up an article provided with two opposing gripping surfaces, in which the control module is provided with an algorithm that operates in the following way, in order to measure the dimension of the article between said two opposing gripping surfaces: ▪the first pickup element is moved towards a first gripping surface of the article, up to a pre-determined position; ▪the second pickup element is operated to perform a first approach stroke of a pre-determined length towards a second gripping surface of the article; ▪if, during the first approach stroke, the first pickup element performs a shift due to the thrust exerted by the second pickup element on the article, the presence of an article is detected by the control module, wherein the distance that separates the gripping surfaces is greater than a distance expected; ▪otherwise, the second pickup element is then operated in order to perform a second approach stroke towards the first pickup element; ▪if, at the end of the second approach stroke by the second pickup element, the first pickup element has performed, due to the thrust exerted by the second pickup element on the article, a shift of length equal to the second approach stroke, the control module detects the presence of an article, wherein the distance that separates the gripping surfaces corresponds to a distance expected; ▪if, at the end of the second approach stroke by the second pickup element, the first pickup element has performed, due to the thrust exerted by the second pickup element on the article, a shift of length lower than the second approach stroke, the control module detects the presence of an article, wherein the distance separating the gripping surfaces is smaller than a distance expected. ▪the first pickup element is moved towards a first gripping surface of the article, up to a pre-determined position; ▪the second pickup element is operated to perform a first approach stroke of a pre-determined length towards a second gripping surface of the article; ▪if, during the first approach stroke, the first pickup element performs a shift due to the thrust exerted by the second pickup element on the article, the presence of an article is detected by the control module, wherein the distance that separates the gripping surfaces is greater than a distance expected; ▪otherwise, the second pickup element is then operated in order to perform a second approach stroke towards the first pickup element; ▪if, at the end of the second approach stroke by the second pickup element, the first pickup element has performed, due to the thrust exerted by the second pickup element on the article, a shift of length equal to the second approach stroke, the control module detects the presence of an article, wherein the distance that separates the gripping surfaces corresponds to a distance expected; ▪if, at the end of the second approach stroke by the second pickup element, the first pickup element has performed, due to the thrust exerted by the second pickup element on the article, a shift of length lower than the second approach stroke, the control module detects the presence of an article, wherein the distance separating the gripping surfaces is smaller than a distance expected.