Copy link to clipboard
Copied
I’m trying to create a script that will place a link image at the bottom left edge of the current document irregardless of the size of the image.
I can use the X axis = 0 to place it at
the left edge but can't figure out how to place it on the bottom edge?
Is there a way to do this?
Copy link to clipboard
Copied
Hi @evan.sante the issue you are facing is while X axis is consistent at 0, the orientation is based on top right as 0,0 XY.
The Y axis is variable according to your post so I'm not sure this is possible with a script.
One far out idea is to create a script that flips the document orientation so that the image is placed in the upper left corner 0,0 - then the document flips orientation back to original after the image is placed. The image would be placed backwards but when flipped is in the right orientation.
Copy link to clipboard
Copied
That's a great solution but unfortunately the File is Text so it doesn't accomplish what I need... Thank You
Copy link to clipboard
Copied
You can use the following scripted version of the alignment options in the move tool:
alignToSel('AdBt');
function alignToSel(method) {
//www.ps-scripts.com/viewtopic.php?f=66&t=7036&p=35273&hilit=align+layer#p35273
/*
//macscripter.net/viewtopic.php?id=38890
AdLf = Align Left
AdRg = Align Right
AdCH = Align Centre Horizontal
AdTp = Align Top
AdBt = Align Bottom
AdCV = Align Centre Vertical
*/
app.activeDocument.selection.selectAll();
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
desc.putReference(charIDToTypeID("null"), ref);
desc.putEnumerated(charIDToTypeID("Usng"), charIDToTypeID("ADSt"), charIDToTypeID(method));
app.activeDocument.selection.deselect();
try {
executeAction(charIDToTypeID("Algn"), desc, DialogModes.NO);
} catch (e) {}
}
https://gist.github.com/MarshySwamp/df372e342ac87854ffe08e79cbdbcbb5
Copy link to clipboard
Copied
Thank You... I will try it out. - CES