Copy link to clipboard
Copied
Hi,
I have a document 4000px wide. I want to create an action which allows me to set the horizontal position (centre-top) of a placed smart object at 2500px. The transform tool isn't working for me as my smart objects are of different dimensions.
Any help would be massively appreciated!
You do not seem to understand how align layer to section works.
You state the vertical position is correct you have done that. however the horizontal positions is off.
You know some pixel you want the horizontal center of the layer align to.
You select that pixel with the rectangle selection tool set to 1px and set the xy of the pixel to make a section of that pixel
You use menu leyer, align the layers selection, horizontal center.
Copy link to clipboard
Copied
At 2500px ???? A document has a canvas size x pixel wide and y pixel high. Where in this xy matrix is pixel 2500. In Photoshop the top left pixel is 0x,0y the bottom right pixel is WidthX,HeightH. It is easy to align a layer top center to a pixel. All you need to is select that pixels and use to align layers to selection vertical top and horizontal center.
Copy link to clipboard
Copied
Sorry, I mean I want the centre of the smart object placed at 2500 on the x (so slightly off-centre). I don't want to adjust the object's position on the y.
At the moment, I'm selecting the object, cmd+T, and entering 2500.00px in the X section at the top of the page. The object is positioned properly, but when I try and do this as part of an action, the new objects are not positioned with the centre at the 2500 point.
Hope this makes sense (and thanks for your help!)
Copy link to clipboard
Copied
How place works is very complex. Every smart Object Layer has an associated transform. When you place in an image file a couple of thing may occur. If there is a difference in the Image DPI resolution and the document resolution Photoshop will match up resolutions. If the number of pixels the smart object has does not fit within the document's canvas size. If your place presences is set to resize during Place the Place transform offered will scale the layer to less the 100% width and 100% height and the layer will fit one canvas otherwise the width and height will be 100% and if the layer does not fit one canvas it will be clipped by the canvas. Actions can not use logic so random size object would be a problem and how place works from object to object may differ and depend on a preference setting. Action normally work with same size objects. I still do not fully understand what you want to do. And I do not think when you do the Ctrl+T free transform on a smart object layer that you realize that shortcut Activates free transform with the smart object layers associated transform setting that including position and scaling that has the done for the object layer. If the Smart Object Current size is ok. But the position not what you want to be. An action can position the layer relative to a pixel using 9 relative point in the object Top left center and right center left center and right and bottom left center and right. As I wrote in my first append. It is easy to select the pixels with the rectangle selection tool set to fixed size 1 px you however need to know its xy position. if the smart object layer need to resize and positioned and sizes vary you would need to use a Photoshop script where you can use logic.
Copy link to clipboard
Copied
Thanks for your reply. Obviously this is more complicated than I thought, so apologies if I've been unclear.
I place an object, and I manually position it at the height I want it to be at (y). I want an action/script that can then move it on to the 2500px position on the x, without affecting its height on the y.
I understand your point about positioning relative to a x,y pixel, but this would affect the level of the object on the y which I don't want to do.
I found a script which looks like it may do what I want at the post below:
Actions/Scripts: Move layer to absolute position instead of translate (Post #2; lines 36-67)
Is this the kind of script you mean?
Copy link to clipboard
Copied
You do not seem to understand how align layer to section works.
You state the vertical position is correct you have done that. however the horizontal positions is off.
You know some pixel you want the horizontal center of the layer align to.
You select that pixel with the rectangle selection tool set to 1px and set the xy of the pixel to make a section of that pixel
You use menu leyer, align the layers selection, horizontal center.
Copy link to clipboard
Copied
Got it, thanks so much for your help!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now