Copy link to clipboard
Copied
Hey everyone. I was wondering the other day, if there is a key stroke or menu function to select only the "current visible" portion of your window or document. For instance....
If you hit command A, it will select the entire canvas. But if you zoom in to a specific are of an image to fill your screen, is there a way to select only THIS new portion? If you hit command A zoomed in, it will still only select the entire image.
I know this is possible with dragging a box using the Marquee tool, but is there a method using a hot key or menu option?
Thanks!
Copy link to clipboard
Copied
No, you cannot select the visible area with a hot key or menu option. You can continue using the Rectangular Marquee as you have been doing.
Jane
Copy link to clipboard
Copied
This could possibly be done with a script. Details are left as an exercise for the reader.
Copy link to clipboard
Copied
There is no such command , but having access to information about the size of the work area, zoom, document size, offsets of the document borders from the work area, we can make such a selection using a script:
#target photoshop
s2t = stringIDToTypeID;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('resolution'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var res = executeActionGet(r).getInteger(p);
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('width'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var docW = executeActionGet(r).getInteger(p) * res / 72;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('height'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var docH = executeActionGet(r).getInteger(p) * res / 72;
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('viewTransform'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var viewTransform = executeActionGet(r).getList(p),
zoom = viewTransform.getDouble(0),
offsetLeft = viewTransform.getDouble(4),
offsetTop = viewTransform.getDouble(5);
(r = new ActionReference()).putProperty(s2t('property'), p = s2t('viewInfo'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'));
var activeView = executeActionGet(r).getObjectValue(p).getObjectValue(s2t('activeView')).getObjectValue(s2t('globalBounds')),
viewW = activeView.getDouble(s2t('right')) - activeView.getDouble(s2t('left')),
viewH = activeView.getDouble(s2t('bottom')) - activeView.getDouble(s2t('top'));
makeSelection(offsetTop < 0 ? 0 : offsetTop,
offsetLeft < 0 ? 0 : offsetLeft,
viewH * zoom + offsetTop > docH ? docH : viewH * zoom + offsetTop,
viewW * zoom + offsetLeft > docW ? docW : viewW * zoom + offsetLeft
)
function makeSelection(top, left, bottom, right) {
var d = new ActionDescriptor();
var d1 = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(s2t("channel"), s2t("selection"));
d.putReference(s2t("null"), r);
d1.putUnitDouble(s2t("top"), s2t("pixelsUnit"), top);
d1.putUnitDouble(s2t("left"), s2t("pixelsUnit"), left);
d1.putUnitDouble(s2t("bottom"), s2t("pixelsUnit"), bottom);
d1.putUnitDouble(s2t("right"), s2t("pixelsUnit"), right);
d.putObject(s2t("to"), s2t("rectangle"), d1);
executeAction(s2t("set"), d, DialogModes.NO);
}
The solution is not ideal, since Photoshop does not provide us information about the sizes of the service interface elements - rulers and scroll bars, and they fall into the selection zone, but in general the script does exactly what you asked.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now