Call javascript not working!
Call javascript not working!
- Subject: Call javascript not working!
- From: Michael Tompsett <email@hidden>
- Date: Thu, 29 Aug 2002 15:58:03 +0100
Trying to call a javascript to move a layer in photoshop.
Javascript works fine when called from applescript when it does not have the
FUNCTION wrapper and xx and yy are replaced by actual numbers.
When it is called with the function wrapper it does not work, and
applescript reports 3undefined2.
Any help?
Applescript:
tell application "Adobe Photoshop 7.0"
activate
do javascript (file "macintosh HD:desktop folder:move.js") with
arguments {-10,-10}
end tell
Javascript below:
function move ( xx, yy )
{
var id152 = charIDToTypeID( "Trnf" );
var desc24 = new ActionDescriptor();
var id153 = charIDToTypeID( "null" );
var ref13 = new ActionReference();
var id154 = charIDToTypeID( "Lyr " );
var id155 = charIDToTypeID( "Ordn" );
var id156 = charIDToTypeID( "Trgt" );
ref13.putEnumerated( id154, id155, id156 );
desc24.putReference( id153, ref13 );
var id157 = charIDToTypeID( "FTcs" );
var id158 = charIDToTypeID( "QCSt" );
var id159 = charIDToTypeID( "Qcs0" );
desc24.putEnumerated( id157, id158, id159 );
var id160 = charIDToTypeID( "Ofst" );
var desc25 = new ActionDescriptor();
var id161 = charIDToTypeID( "Hrzn" );
var id162 = charIDToTypeID( "#Rlt" );
desc25.putUnitDouble( id161, id162, xx );
var id163 = charIDToTypeID( "Vrtc" );
var id164 = charIDToTypeID( "#Rlt" );
desc25.putUnitDouble( id163, id164, yy );
var id165 = charIDToTypeID( "Ofst" );
desc24.putObject( id160, id165, desc25 );
executeAction( id152, desc24, DialogModes.NO );
}
// Call move with values provided in the "arguments" collection emboss (
arguments[0], arguments[1] ) ;
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.