What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

relative move by percentage


gtopcu

New Member
Messages
2
Likes
0
Hi all,

I'm trying to define my own watermark (just a piece of text) and define it as an action so that I can apply it as batch.

I'm creating a text layer as the signature, and I would like to move this text layer to the lower right corner of every image. For this, I'm trying to find a move by percentage command that will work for any image size. i.e. the signature must appear at 90% of the width and %92 of the height, regardless if the image is 2592x1728 or 1728x2592 pixels.

Any ideas to do a 'move by percentage' or alternative ways to achieve this?

Many thanks.
 
Not possible with an action, but easy with a script.

Using ExtendScript Toolkit (This is installed with Photoshop)
Copy and paste the code into Extendscript.
This utility can be found in the relevant folder:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities
Applications/Utilities/Adobe Utilities/ExtendScript Toolkit
The script needs to be saved into:-
PC: C:\Program Files\Adobe\Adobe Photoshop CS#\Presets\Scripts
NB: Vista and Windows 7 you will have to save it elsewhere and copy it to this folder due to permissions.
MAC: <hard drive>/Applications/Adobe Photoshop CS#/ Presets/Scripts
If Photoshop was open, close and restart Photoshop so that it can pickup the new script.
Code:
#target photoshop
main();
function main(){
if(!documents.length) return;
if(activeDocument.activeLayer.kind != LayerKind.TEXT) return;
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var X = (activeDocument.width/100)*90;
var Y = (activeDocument.height/100)*92;
var LB = activeDocument.activeLayer.bounds;
var LX = LB[2].value;
var LY = LB[3].value;
activeDocument.activeLayer.translate(X-LX,Y-LY);
app.preferences.rulerUnits = startRulerUnits;
}
Then as part of your action after you have created you text layer
File - Scripts and select the script


This will place the text as per your locations.
 
wonderfully explained to a complete newbie like me, and works perfectly. kudos mate, you're a real pro!


Not possible with an action, but easy with a script.

Using ExtendScript Toolkit (This is installed with Photoshop)
Copy and paste the code into Extendscript.
This utility can be found in the relevant folder:-
PC: C:\Program Files\Adobe\Adobe Utilities
MAC: <hard drive>/Applications/Utilities/Adobe Utilities
Applications/Utilities/Adobe Utilities/ExtendScript Toolkit
The script needs to be saved into:-
PC: C:\Program Files\Adobe\Adobe Photoshop CS#\Presets\Scripts
NB: Vista and Windows 7 you will have to save it elsewhere and copy it to this folder due to permissions.
MAC: <hard drive>/Applications/Adobe Photoshop CS#/ Presets/Scripts
If Photoshop was open, close and restart Photoshop so that it can pickup the new script.
Code:
#target photoshop
main();
function main(){
if(!documents.length) return;
if(activeDocument.activeLayer.kind != LayerKind.TEXT) return;
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var X = (activeDocument.width/100)*90;
var Y = (activeDocument.height/100)*92;
var LB = activeDocument.activeLayer.bounds;
var LX = LB[2].value;
var LY = LB[3].value;
activeDocument.activeLayer.translate(X-LX,Y-LY);
app.preferences.rulerUnits = startRulerUnits;
}
Then as part of your action after you have created you text layer
File - Scripts and select the script


This will place the text as per your locations.
 

Back
Top