Login  Register

Paste issue using the 'setSelectionLocation' function

Posted by Conor Creedon on Nov 18, 2009; 2:27pm
URL: http://imagej.273.s1.nabble.com/Cycloid-grids-tp3688866p3688872.html

Hi,

Has anyone come across an issue when trying to paste into a particular
area of an image using the setSelectionLocation function. For some
reason, the paste location always defaults to the centre of the image
for the first occurrence but pastes correctly (into the top left corner
based on the lines below) only on the second occurrence. It is very
frustrating and any workaround would be appreciated!

makeRectangle(100,100,100,100);
run("Copy");
setSelectionLocation(1,1);
run("Paste"); // pastes to centre of image when run
setSelectionLocation(1,1);
run("Paste"); // only now pastes to the top left corner of image when
run


Regards,

Conor.