Skip to content

Instantly share code, notes, and snippets.

@theMikeD
Last active May 31, 2020 04:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theMikeD/c8b82084914a55590141 to your computer and use it in GitHub Desktop.
Save theMikeD/c8b82084914a55590141 to your computer and use it in GitHub Desktop.
Photoshop script to call one of two different actions depending on the aspect of the image
#target photoshop
// Mini-Script to call one of two different actions depending on the aspect of the image.
// This one requires editing by the end user.
// (c) Mike Dickson www.photoshoptools.ca
// Licensed under the GPL
docRef = activeDocument;
rulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// If this is a landscape picture...
if ( docRef.height.value < docRef.width.value ) {
// EDIT HERE
app.doAction("YOUR LANDSCAPE ACTION NAME", "YOUR ACTION SET");
} else {
// EDIT HERE
app.doAction("YOUR PORTRAIT ACTION NAME", "YOUR ACTION SET");
}
app.preferences.rulerUnits = rulerUnits;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment