I don't think that's possible with just an action, but it is with scripting.
Try to record it this way:
First align the photo layer to top and right edge of the background layer.
Ctrl+A / Layer > Align > ...
This way the upper right corner of the photo gets the coordinates x=1920 and y=0.
Then choose the reference point and use the x | y coordinates for positioning the photo.
I thought so, but I have to learn it from scratch...
Wow Fenja! What a smart solution!!
It works fine and I'm impressed!
Thanks a lot! Thilo