Hello,
i have a script that will respace masks on a page for my program.
I have one user who is on CS2 with a Mac (OS X) and he is experiencing a problem.
The script should prompt him for a space in pixels (say 30) and then respace those. It works fine on most of my users.
but for him, he ends up with the scripts overlapping, wow!
Here is the script. Please download the action and run it on a 10x20 photoshop document and see if it works for you.
Code: Select all//©Fundy SOS
#target photoshop
if(documents.length == 0){
alert("You require a document to be open first!");
}else{
masks();
}
function masks(){
maskDlg =
"dialog{text:'Script Interface',bounds:[100,100,490,220],"+
"panel0:Panel{bounds:[10,10,380,110] , text:'' ,properties:{borderStyle:'etched',su1PanelCoordinates:true},"+
"statictext0:StaticText{bounds:[10,10,170,30] , text:'Please Select Masks to Space.' ,properties:{scrolling:undefined,multiline:undefined}},"+
"button0:Button{bounds:[10,70,70,91] , text:'Ok' },"+
"button1:Button{bounds:[300,70,360,91] , text:'Cancel' },"+
"dropdown0:DropDownList{bounds:[175,10,360,30]},"+
"statictext2:StaticText{bounds:[10,40,170,60] , text:'Enter No Of Pixel Seperation.' ,properties:{scrolling:undefined,multiline:undefined}},"+
"seperation:EditText{bounds:[180,40,220,60] , text:'10' ,properties:{multiline:false,noecho:false,readonly:false}}}};";
win = new Window(maskDlg,"Space Masks");
win.center();
win.panel0.seperation.active=true;
var Masks=[["Two Across",0,"TwoAcross"],
["Two Down",0,"TwoDown"],
["Three Across",0,"ThreeAcross"],
["Three down",0,"ThreeDown"],
["Four Across",0,"FourAcross"],
["Four down",0,"FourDown"],
["Four Square",0,"FourSquare"],
["Three across Two down",0,"ThreeAcrossTwoDown"],
["Two across Three down",0,"TwoAcrossThreeDown"],
["Four across Two down",0,"FourAcrossTwoDown"],
["Two across Four down",0,"TwoAcrossFourDown"],
["Nine Square",0,"NineSquare"],
["Four across Three down",0,"FourAcrossThreeDown"],
["Three across Four down",0,"ThreeAcrossFourDown"],
["Sixteen Square",0,"SixteenSquare"]];
for (var a =0; a<activeDocument.artLayers.length;a++){
switch (activeDocument.artLayers[a].name){
case '2H1' : Masks[0][1] = 1; break;
case '2V1' : Masks[1][1] = 1; break;
case '3H1' : Masks[2][1] = 1; break;
case '3V1' : Masks[3][1] = 1; break;
case '4H1' : Masks[4][1] = 1; break;
case '4V1' : Masks[5][1] = 1; break;
case '4S1' : Masks[6][1] = 1; break;
case '6HS1' : Masks[7][1] = 1; break;
case '6VS1' : Masks[8][1] = 1; break;
case '8H1' : Masks[9][1] = 1; break;
case '8V1' : Masks[10][1] = 1; break;
case '9S1' : Masks[11][1] = 1; break;
case '12HS1' : Masks[12][1] = 1; break;
case '12VS1' : Masks[13][1] = 1; break;
case '16S1' : Masks[14][1] = 1; break;
default : break;
}
}
var maskGroup=[];
for (i in Masks) {
if(Masks[1] == 1){
win.panel0.dropdown0.add('item',Masks[0]);
maskGroup.push(Masks[2]);
}
}
win.panel0.dropdown0.selection=0;
var maskSel = 0;
win.panel0.dropdown0.onChange = function(){
maskSel = parseInt(this.selection);
}
var done = false;
while (!done) {
if (maskGroup.length == 0) {
alert("No Masks to Space");
return;
}
var x = win.show();
if (x == 0 || x == 2) {
win.canceled = true;
done = true;
} else if (x == 1) {
done = true;
var result = valiDate();
if(result != true) {
alert(result);
return;
}else
{
eval(maskGroup[maskSel]+"("+ parseInt(win.panel0.seperation.text)+");");
}
}
}
}
function valiDate(){
return true;
}
function TwoAcross(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["2H1","2H2"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("2H1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("2H2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function TwoDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["2V1","2V2"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("2V1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("2V2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function ThreeAcross(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["3H1","3H2","3H3"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("3H1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("3H2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("3H3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function ThreeDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["3V1","3V2","3V3"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("3V1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("3V2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("3V3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function FourAcross(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["4H1","4H2","4H3","4H4"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("4H1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4H2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4H3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4H4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function FourDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["4V1","4V2","4V3","4V4"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("4V1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4V2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4V3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4V4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function FourSquare(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["4S1","4S2","4S3","4S4"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S3");
LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("4S4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function ThreeAcrossTwoDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["6HS1","6HS2","6HS3","6HS4","6HS5","6HS6"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS4");
LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS1");
LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS2");
LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS3");
LB = app.activeDocument.activeLayer.bounds;
var X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6HS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function TwoAcrossThreeDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["6VS1","6VS2","6VS3","6VS4","6VS5","6VS6"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS5");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("6VS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function FourAcrossTwoDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["8H1","8H2","8H3","8H4","8H5","8H6","8H7","8H8"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H5");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H4");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8H8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function TwoAcrossFourDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["8V1","8V2","8V3","8V4","8V5","8V6","8V7","8V8"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V5");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V7");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("8V8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function NineSquare(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["9S1","9S2","9S3","9S4","9S5","9S6","9S7","9S8","9S9"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S4");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S7");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("9S9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function FourAcrossThreeDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["12HS1","12HS2","12HS3","12HS4","12HS5","12HS6","12HS7","12HS8","12HS9","12HS10","12HS11","12HS12"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS5");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS9");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS10");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS10");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS4");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12HS12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function ThreeAcrossFourDown(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames = ["12VS1","12VS2","12VS3","12VS4","12VS5","12VS6","12VS7","12VS8","12VS9","12VS10","12VS11","12VS12"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS4");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS7");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS10");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS10");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("12VS12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function SixteenSquare(pixels){
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var LayerNames =["16S1","16S2","16S3","16S4","16S5","16S6","16S7","16S8","16S9","16S10","16S11","16S12","16S13","16S14","16S15","16S16"];
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Hd ');
}
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S1");
var LB = app.activeDocument.activeLayer.bounds;
var X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S2");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S3");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S4");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S5");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S9");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S10");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S13");
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S14");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0)
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S15");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
LB = app.activeDocument.activeLayer.bounds;
X = LB[2].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S16");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(parseInt(X) - parseInt(LB[0]),0);
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S1");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S5");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S9");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S13");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S2");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S6");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S10");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S14");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S3");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S7");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S11");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S15");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S4");
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S8");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S12");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
LB = app.activeDocument.activeLayer.bounds;
X = LB[3].value + pixels;
activeDocument.activeLayer = activeDocument.artLayers.getByName("16S16");
LB = app.activeDocument.activeLayer.bounds;
activeDocument.activeLayer.translate(0,parseInt(X) - parseInt(LB[1]));
for(var a=0;a<LayerNames.length;a++){
activeDocument.activeLayer = activeDocument.artLayers.getByName(LayerNames[a]);
ShowHideFX('Shw ');
}
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;
};
function selectLayerByName(lyrName,add){
add = undefined ? add = false:add
var desc = new ActionDescriptor();
var ref = new ActionReference();
ref.putName( charIDToTypeID( "Lyr " ), lyrName);
desc.putReference( charIDToTypeID( "null" ), ref );
if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) );
desc.putBoolean( charIDToTypeID( "MkVs" ), false );
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
};
function ShowHideFX(FX) {
function cTID(s) { return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };
//FX Hide = 'Hd ' Show = 'Shw '
var desc93 = new ActionDescriptor();
var list3 = new ActionList();
var ref66 = new ActionReference();
ref66.putClass( cTID('Lefx') );
ref66.putEnumerated( cTID('Lyr '), cTID('Ordn'), cTID('Trgt') );
list3.putReference( ref66 );
desc93.putList( cTID('null'), list3 );
executeAction( cTID(FX), desc93, DialogModes.NO );
};