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
/** | |
* ---Required ps functions--- | |
* psNewGroup | |
* psNewPath | |
* psNewLayer | |
* psNewMask | |
* psAdjColourFill | |
* psApplyImgMask | |
* psDuplicate | |
*/ |
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
var folder = 'C:\\LocalStorage'; // resource folder | |
var benchmarkFile = 'C:\\LocalStorage\\benchmark.csv'; // test results | |
/** | |
* The functions you combine in this method will be benchmark tested | |
* @param fileName - Target file | |
*/ | |
function psAction(fileName){ | |
psOpenFile(fileName); | |
psDefaultUnits(); |
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 startDisplayDialogs = app.displayDialogs | |
var startBgColor = app.backgroundColor |
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 | |
app.bringToFront(); | |
var docRef = app.activeDocument; | |
var doc = activeDocument; | |
var Res= 72 | |
var Width= 1000 | |
var Height= 1000 |
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
var docRef = app.activeDocument; | |
try{ | |
var numPaths = docRef.pathItems.length; | |
var topPath = docRef.pathItems[0]; | |
var topPathSub = docRef.pathItems[0].subPathItems[0]; | |
if (numPaths > 0){ | |
topPath.makeSelection(); | |
docRef.selection.makeWorkPath(5); |
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
var docRef = app.activeDocument; | |
try{ | |
var numPaths = docRef.pathItems.length; | |
var countPoints = docRef.pathItems[0].subPathItems[0].pathPoints.length; | |
if (numPaths > 0){ | |
alert(countPoints); | |
} | |
} |
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
var docRef = app.activeDocument; | |
var numPaths = docRef.pathItems.length; | |
var pathsLeft = numPaths | |
if (numPaths > 0){ | |
for (var i = 0; i < pathsLeft; i++){ | |
var pathSelected = docRef.pathItems[i]; | |
if(pathSelected.subPathItems.length==0){ | |
docRef.pathItems[i].remove(); |
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
/** | |
* ---Required ps functions--- | |
* psNewPath | |
*/ | |
var doc = app.activeDocument; | |
//create the path items | |
psNewPath("Outline"); | |
psNewPath("Strap"); |
NewerOlder