This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target photoshop | |
#target estoolkit | |
app.bringToFront(); | |
var win; | |
var winResource; | |
winResource = "dialog { \ | |
orientation: 'column', \ | |
alignChildren: ['fill', 'top'], \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enable double clicking | |
#target photoshop | |
app.bringToFront(); | |
var doc = activeDocument; | |
// Save the current preferences | |
var startRulerUnits = app.preferences.rulerUnits; | |
var startTypeUnits = app.preferences.typeUnits; | |
var startDisplayDialogs = app.displayDialogs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// enable double clicking | |
#target photoshop | |
app.bringToFront(); | |
var doc = activeDocument, | |
docName = activeDocument.name; | |
// Save the current preferences | |
var startRulerUnits = app.preferences.rulerUnits, | |
startTypeUnits = app.preferences.typeUnits, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psDuplicate(sourceName,destName,vis,lock,showHide){ | |
//"HdAl" - Hide All; "RvlA" - Reveal All; "RvlS" - Reveal Selection | |
var doc = app.activeDocument; | |
if(doc.activeLayer.isBackgroundLayer){ | |
doc.activeLayer.duplicate(); | |
doc.layers.name = destName; //variable must be string | |
} else { | |
doc.layers.getByName(sourceName).duplicate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psApplyImgMask(sourceName,destName){ | |
cTID = function(s) { return app.charIDToTypeID(s); }; | |
sTID = function(s) { return app.stringIDToTypeID(s); }; | |
app.activeDocument.activeLayer = doc.artLayers.getByName(destName); //variable must be string | |
var descAIM1 = new ActionDescriptor(); | |
var refAIM1 = new ActionReference(); | |
refAIM1.putEnumerated(cTID("Chnl"), cTID("Chnl"), cTID("Msk ")); | |
descAIM1.putReference(cTID("null"), refAIM1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psAdjColourFill(layerName,r,g,b){ | |
cTID = function(s) { return app.charIDToTypeID(s); }; | |
sTID = function(s) { return app.stringIDToTypeID(s); }; | |
psNewLayer(layerName,null,null,null); | |
var descACF1 = new ActionDescriptor(); | |
var refACF1 = new ActionReference(); | |
refACF1.putClass(sTID("contentLayer")); | |
descACF1.putReference(cTID("null"), refACF1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psNewMask(showHide,appliedLayer){ | |
//"HdAl" - Hides; "RvlA" - Reveal All; "RvlS" - Reveal Selection | |
try{ | |
app.activeDocument.activeLayer = doc.artLayers.getByName(appliedLayer); //variable must be string | |
} | |
catch(e){ | |
} | |
cTID = function(s) { return app.charIDToTypeID(s); }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psNewLayer(layerName,vis,lock,showHide){ | |
//"HdAl" - Hides; "RvlA" - Reveal All; "RvlS" - Reveal Selection | |
var doc = app.activeDocument; | |
if(app.activeDocument.activeLayer.isBackgroundLayer){ | |
app.activeDocument.activeLayer.name = layerName; //variable must be string | |
} else { | |
doc.artLayers.add().name = layerName; //variable must be string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psNewPath(pathName){ | |
var doc = activeDocument; | |
try{ | |
doc.pathItems.add(pathName, new Array()); //variable must be string | |
} | |
catch(e){ | |
doc.pathItems.add(pathName+" 001", new Array()); //variable must be string | |
} | |
doc.pathItems.getByName(pathName).deselect(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function psNewGroup(groupName,vis,lock,showHide){ | |
//"HdAl" - Hides; "RvlA" - Reveal All; "RvlS" - Reveal Selection | |
var doc = activeDocument; | |
doc.layerSets.add().name = groupName; //variable must be string | |
if(!showHide) {showHide=null} else {psNewMask(showHide,null);} | |
if(vis==false) {doc.layerSets.getByName(groupName).visible = vis} else {lock=null;} | |
if(!lock) {lock=null} else {doc.layerSets.getByName(groupName).allLocked = lock;} | |
} |
NewerOlder