This file contains 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 DocumentArea = function(doc) { | |
this.doc = doc; | |
}; | |
DocumentArea.prototype.bounds = function() { | |
return [0, 0, this.doc.width, this.doc.height]; | |
}; | |
var DocumentArea = function(doc) { | |
this.doc = doc; |
This file contains 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 | |
function main(){ | |
if(!documents.length) return; | |
var doc = activeDocument; | |
var oldPath = activeDocument.path; | |
for(var a=0;a<doc.layerSets.length;a++){ | |
activeDocument.activeLayer = activeDocument.layers.getByName(doc.layerSets[a].name); | |
dupLayers(); | |
var saveFile= File(oldPath +"/"+doc.layerSets[a].name +".png"); | |
SavePNG(saveFile); |
This file contains 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
/** | |
* Photoshop script for preparing a sprite for rotating animation. | |
* Input : a starting sprite and number of frames | |
* Output: the specified number of layers ready to be used in the PS animation tool | |
*/ | |
var docRef = app.activeDocument; | |
var activeLayer = docRef.activeLayer; | |
var degToRotate = null; | |
var newLayer = null; |
This file contains 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
//This will be the direcotry of the images | |
var workFolder = Folder("Z:/Bermudez-Hernandez/Strains Project/Animals/C57_20/Prox1_NeuN/Slide2"); | |
var folders = workFolder.getFiles(); | |
runphotomergeFromScript = true; | |
//runphotomergeFromScript = true; | |
$.evalFile( "C:/Program Files/Adobe/Adobe Photoshop CC/Presets/Scripts/Photomerge.jsx") | |
//photomerge.createPanorama( | |
//fileList, displayDialog ); | |
psdOpts = new PhotoshopSaveOptions(); |
This file contains 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
/*Maximum spriteSheet width -> FIXED*/ | |
var maxWidth = 256; | |
var filename = activeDocument.name.replace(".psd",""); | |
var file = new File(activeDocument.fullName.path+"/"+filename+".xml"); | |
var AD = activeDocument; | |
var output = new File(activeDocument.fullName.path+"/"+filename+".png"); | |
var pngOptions = new PNGSaveOptions(); |
This file contains 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
app.activeDocument.suspendHistory("Export as png", "main()"); | |
function main() { | |
if (app.documents.length) { | |
var docRef = app.activeDocument; | |
if (docRef.layers.length) { | |
var selected = getSelectedLayersIdx(); | |
for (var i = 0; i < selected.length; i++) { | |
var layer = selectByIndex(selected[i]), | |
width = layer.bounds[2] - layer.bounds[0], |
This file contains 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
/* | |
The original files are 960x319. | |
Image sizes to save: | |
* 800x266 - Retina for 480x320 resolution (400 logical pixel wide panel areas) | |
* 740x246 - Desktop and iPad | |
* 616x205 - Retina for 320x480 resolution (308 logical pixel wide panel areas) | |
* 400x133 - 480x320 resolution | |
* 308x102 - 320x480 resolution |
This file contains 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
main(); | |
function main(){ | |
var doc = activeDocument; | |
var docPath = activeDocument.path; | |
var marketApps = doc.layerSets.getByName("Group Name"); | |
for(var a=0; a<marketApps.layers.length; a++){ | |
//alert(marketApps.layers[a]); |
This file contains 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
// Install by saving to PHOTOSHOP_DIRECTORY/Presets/Scripts | |
// Also works just by opening it with File->Open.. | |
// Once installed, you can add an action to run it with a keyboard shortcut | |
// Open Actions window (Window->Actions) | |
// Click the "Create a New Action" Button (dog-eared paper icon) | |
// Choose the name of the action and the shortcut keys you want | |
// Click Record | |
// Select Insert Menu Item... | |
// Select File->Scripts->toggleLayerType |
This file contains 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 | |
var currentDoc = app.activeDocument; | |
for ( var i = 0; i < currentDoc.layers.length; i++ ) { | |
var layer = currentDoc.layers[i]; | |
if( layer.kind === LayerKind.HUESATURATION ) | |
{ | |
layer.visible = layer.visible ? false : true; | |
} |