I am a newbie. In Photoshop CS, I’m using Applescript to rotate a layer around a point of “my” choosing rather than the fixed options of Middle, right corner, left corner… found in the Photoshop command.
I’m stumped as to how to do it in Applescript, so I invoked ScriptListener.js and it yielded this Javascript which works fine when called. My newbie problem is trying to take the text field values I manually enter into an applescript application created in Xcode and pass them to this bit of Javascript to replace the values (602.000000, 1509.104869, 10.000000, -0.000000, 101.000000, 101.000000, 0.300000).
for clarification:
(602.000000 is the x coordinate of the rotation point,
1509.104869 is the y coordinate of the rotation point,
10.000000 nudged/move the layer 10.000000 pixels to the right/left,
-0.000000 nudged/move the layer -0.000000 pixels to up/down,
101.000000 is the horizontal scale value,
101.000000 is the vertical scale value,
0.300000 is the rotation amount)
The bit of Javascript…
var id28 = charIDToTypeID( “Trnf” );
var desc6 = new ActionDescriptor();
var id29 = charIDToTypeID( “null” );
var ref3 = new ActionReference();
var id30 = charIDToTypeID( "Lyr " );
var id31 = charIDToTypeID( “Ordn” );
var id32 = charIDToTypeID( “Trgt” );
ref3.putEnumerated( id30, id31, id32 );
desc6.putReference( id29, ref3 );
var id33 = charIDToTypeID( “FTcs” );
var id34 = charIDToTypeID( “QCSt” );
var id35 = charIDToTypeID( “Qcsi” );
desc6.putEnumerated( id33, id34, id35 );
var id36 = charIDToTypeID( “Pstn” );
var desc7 = new ActionDescriptor();
var id37 = charIDToTypeID( “Hrzn” );
var id38 = charIDToTypeID( “#Pxl” );
desc7.putUnitDouble( id37, id38, 602.000000 );
var id39 = charIDToTypeID( “Vrtc” );
var id40 = charIDToTypeID( “#Pxl” );
desc7.putUnitDouble( id39, id40, 1509.104869 );
var id41 = charIDToTypeID( "Pnt " );
desc6.putObject( id36, id41, desc7 );
var id42 = charIDToTypeID( “Ofst” );
var desc8 = new ActionDescriptor();
var id43 = charIDToTypeID( “Hrzn” );
var id44 = charIDToTypeID( “#Pxl” );
desc8.putUnitDouble( id43, id44, 10.000000 );
var id45 = charIDToTypeID( “Vrtc” );
var id46 = charIDToTypeID( “#Pxl” );
desc8.putUnitDouble( id45, id46, -0.000000 );
var id47 = charIDToTypeID( “Ofst” );
desc6.putObject( id42, id47, desc8 );
var id48 = charIDToTypeID( “Wdth” );
var id49 = charIDToTypeID( “#Prc” );
desc6.putUnitDouble( id48, id49, 101.000000 );
var id50 = charIDToTypeID( “Hght” );
var id51 = charIDToTypeID( “#Prc” );
desc6.putUnitDouble( id50, id51, 101.000000 );
var id52 = charIDToTypeID( “Angl” );
var id53 = charIDToTypeID( “#Ang” );
desc6.putUnitDouble( id52, id53, 0.300000 );
var id54 = charIDToTypeID( “Lnkd” );
desc6.putBoolean( id54, true );
executeAction( id28, desc6, DialogModes.NO );
I could really use some help.
fermi