Version 2 has minor changes.
I think it is cleaner than version one like it resizes the frame layer to image size so that the layer isn't 1 pixel higher and 1 pixel lower than image size (I needed to make it 1 pixel wider in top/bottom direction because of transform perspective artifacts that didn't fully make corners meet).
And it also puts your original image on top so that it's not covered by frame's 1 pixel wide border (in the inner part, also to avoid 1 pixel error artifacts by transform tool).
Tin, I really love this script, gives lovely border. I did have a problem with one that I have repeated several times to check. I said no to Mirror but the image of the cat and bird are in the border anyway.
Tin Tran.Perspective Border Mirror.jpg # (159.6 KiB) Viewed 5260 times Thumbnail
Tin Tran.Perspective Border No Mirror.jpg # (373.17 KiB) Viewed 5260 times Thumbnail