Copy link to clipboard
Copied
Hi, I have a document where I executed a script creating a single horizontal guide based on a marquee selection. That guide is always in a different position.
Now I want to make a new marquee selection (the old one is deselected), selecting everything above that guide (the selection attached to it).
Is there an action or script for this?
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS
var aDoc = activeDocument;
var Sel = aDoc.selection.bounds;
aDoc.guides.add(Direction.HORIZONTAL, Sel[1]);
activeDocument.selection.select([[0,0], [activeDocument.width,0], [activeDocument.width, Sel[1]], [0, Sel[1]]])
Copy link to clipboard
Copied
@TK949 – It may help to share the original script in order to create a new script to "pick up where it left off"...
Copy link to clipboard
Copied
Found it here in the discussions:
// regards pixxxel schubser
var aDoc = activeDocument;
var Sel = aDoc.selection.bounds;
aDoc.guides.add(Direction.HORIZONTAL, Sel[1].as('px'));
I'm a total noob with scripts.
Copy link to clipboard
Copied
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS
var aDoc = activeDocument;
var Sel = aDoc.selection.bounds;
aDoc.guides.add(Direction.HORIZONTAL, Sel[1]);
activeDocument.selection.select([[0,0], [activeDocument.width,0], [activeDocument.width, Sel[1]], [0, Sel[1]]])
Copy link to clipboard
Copied
Thank you, that did it.
Copy link to clipboard
Copied
jazz-y has come to the rescue yet again, I was just going to suggest that you use Select > Reselect and then Select > Inverse, assuming that the original marquee selection was in that session without another selection being added (also assuming that the original selection went all the way to the canvas edges...yes, a lot of assumptions!).