How to select a rectangle which was inserted from the clipboard?
For a batch run of inserting images I'm facing this situation:
There is a document with a lot of paragraphs containing an image file name like "034.tif".
I have a rectangle which has the exact size and style how the images must be placed.
I copy this to the clipboard.
Then I run a script which seeks for image file names and replaces them with the contents of the clipboard (the desired rectangle).
If the script stops here, the cursor is placed directly after the just inserted rectangle.
How can the script select the rectangle left of the cursor so that the image is inserted into the rectangle instead of after it?
The script now looks like that:
// copy the desired rectangle to the clipboard manually
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "002.tif";
app.changeGrepPreferences.changeTo = "~c";
var myPlace = app.changeGrep();
// here is the point where I need to select the rectangle which changeGrep just inserted
myPlace[0].place('002.tif', false);