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

Flip Selection

New Here ,
Jul 18, 2008 Jul 18, 2008

Copy link to clipboard

Copied

How do you flip a selection in Javascript? All the CS3 JavaScript Scripting Reference says is

"Note: To flip the selection shape, see rotate."

but then nothing about it under rotate.

thanks
TOPICS
Actions and scripting

Views

429

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
Adobe
New Here ,
Jul 18, 2008 Jul 18, 2008

Copy link to clipboard

Copied

If there is a cleaner way please post but this does it via scriptListener, pass "v" or "h" to the function:

function flipSelection(direction){
var dir = "Vrtc"
if(direction=="h"){
dir="Hrzn"
}
var id17 = charIDToTypeID( "Flip" );
var desc4 = new ActionDescriptor();
var id18 = charIDToTypeID( "null" );
var ref2 = new ActionReference();
var id19 = charIDToTypeID( "Lyr " );
var id20 = charIDToTypeID( "Ordn" );
var id21 = charIDToTypeID( "Trgt" );
ref2.putEnumerated( id19, id20, id21 );
desc4.putReference( id18, ref2 );
var id22 = charIDToTypeID( "Axis" );
var id23 = charIDToTypeID( "Ornt" );
var id24 = charIDToTypeID( dir );
desc4.putEnumerated( id22, id23, id24 );
executeAction( id17, desc4, DialogModes.NO );
}

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
Valorous Hero ,
Jul 18, 2008 Jul 18, 2008

Copy link to clipboard

Copied

LATEST
app.activeDocument.flipCanvas(Direction.HORIZONTAL);
app.activeDocument.flipCanvas(Direction.VERTICAL);

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