• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Action/Script to select everything above guide?

Community Beginner ,
Jul 26, 2022 Jul 26, 2022

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?

TOPICS
Actions and scripting

Views

286

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jul 27, 2022 Jul 27, 2022
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]]])

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 26, 2022 Jul 26, 2022

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"...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 26, 2022 Jul 26, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 27, 2022 Jul 27, 2022

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]]])

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

Thank you, that did it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 27, 2022 Jul 27, 2022

Copy link to clipboard

Copied

LATEST

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!).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines