Layers can be positioned. So yes a watermark layer can be positioned randomly. Generating a random position may be a bit tricky. For once you generate a position you would need to calculate if the bounds of the watermark layer positioned there would lie within the documents canvas area. You could also create a set of fixed locations then randomly choose one of those.
This will randomly place the current layer in the image. Adapt is to use your watermark. The watermark layer has to be selected for it to work.
#target photoshop var doc = activeDocument var curLayer = doc.activeLayer var xSize = curLayer.bounds-curLayer.bounds var x = Math.random() *(doc.width - xSize) var ySize = curLayer.bounds-curLayer.bounds var y = Math.random() *(doc.height - ySize) curLayer.translate(x-curLayer.bounds,y-curLayer.bounds);
Thanks just what I was looking for
and if you can also vary the size of the text?
Is you're watermark just a text layer?
If so, you just create a random statement to change the text size. The rule for creating a random number is:
random number X number range + number offset
thank you very much