Free transform

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

meiyunyou
Posts: 20
Joined: Tue May 26, 2020 9:11 am

Free transform

Post by meiyunyou »

Such as layer 1
The pixel size is 200
How to put the layer 2
Free transform change into 200

I'm sorry, my English is not very good

I just want to make the size of the layer 1 and layer 2 same
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Free transform

Post by Kukurykus »

You need 2 layers in document, where the higher layer is selected:

Code: Select all

lrs = activeDocument.layers
function wah(v) {return [v[2] - v[0], v[3] - v[1]]}
l0 = wah(lrs[0].bounds), l1 = wah(lrs[1].bounds)
lrs[0].resize((l1[0] / l0[0]) * 100, (l1[1] / l0[1]) * 100)
meiyunyou
Posts: 20
Joined: Tue May 26, 2020 9:11 am

Re: Free transform

Post by meiyunyou »

Thank you, thank you very much