Re: Photoshop - positionning layers
Re: Photoshop - positionning layers
- Subject: Re: Photoshop - positionning layers
- From: "Michael Schmidt (BRT)" <email@hidden>
- Date: Tue, 14 Oct 2008 12:35:04 +0200
Maybe this could help:
property moveActiveLayerScript : "function moveLayer(byX, byY) {
var id50 = charIDToTypeID( \"move\" );
var desc7 = new ActionDescriptor();
var id51 = charIDToTypeID( \"null\" );
var ref3 = new ActionReference();
var id52 = charIDToTypeID( \"Lyr \" );
var id53 = charIDToTypeID( \"Ordn\" );
var id54 = charIDToTypeID( \"Trgt\" );
ref3.putEnumerated( id52, id53, id54 );
desc7.putReference( id51, ref3 );
var id55 = charIDToTypeID( \"T \" );
var desc8 = new ActionDescriptor();
var id56 = charIDToTypeID( \"Hrzn\" );
var id57 = charIDToTypeID( \"#Pxl\" );
desc8.putUnitDouble( id56, id57, byX );
var id58 = charIDToTypeID( \"Vrtc\" );
var id59 = charIDToTypeID( \"#Pxl\" );
desc8.putUnitDouble( id58, id59, byY );
var id60 = charIDToTypeID( \"Ofst\" );
desc7.putObject( id55, id60, desc8 );
executeAction( id50, desc7, DialogModes.NO );
}
moveLayer(arguments[0], arguments[1])
"
tell application "Adobe Photoshop CS3"
activate
set docRef to current document
set NewLayer to current layer of docRef
tell NewLayer
if not background layer then
-- setting target's coordinates
set targetX to 50
set targetY to 87
-- getting source's coordinates
set {x1, y1, x2, y2} to bounds
-- move layer using the coordinate's differences
do javascript (moveActiveLayerScript) with arguments {targetX -
x1, targetY - y1}
else
display dialog "The background layer can't be moved."
end if
end tell
end tell
Greetings from Hamburg,
Michael Schmidt
Am 14.10.2008 um 12:28 schrieb Jay Louvion:
On 14.10.2008 12:23, "Shane Stanley" <email@hidden>
spake thus:
translate current layer delta x <some value> delta y <some value>
Thanks, Shane – unfortunately, this is returned : “Adobe Photoshop
CS3 got an error: File/Folder expected” ?
I inserted your recommendation after having replaced <some value 1>
by a variable and <some value 2> by 0.
Any further ideas ?
j.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden