Skip to content

Instantly share code, notes, and snippets.

View jalbertbowden's full-sized avatar

albert jalbertbowden

View GitHub Profile
@jalbertbowden
jalbertbowden / checkEmail.php
Created March 24, 2019 01:37 — forked from voku/checkEmail.php
check for E-Mail
<?php
/**
* checkEmail
*
* @param String $email
* @param Boolean $mxCheck (do not use, if you don't need it)
*
* @return Boolean
*/
data:text/html;charset=utf-8, <title>Writability</title><body OnLoad='document.body.focus();' contenteditable style="font-size:21px;line-height:1.6;font-family:'Chaparral Pro',Georgia;max-width:21em;margin:0 auto;padding:3rem;background-color:rgb(233,233,225);color:rgb(68,68,68);" spellcheck="false">
var layerNum = app.activeDocument.layers.length;
var a = [];
for (var i = 0; i < layerNum; i++) {
a[i] = '"' + app.activeDocument.layers[i].name + '"';
}
prompt("Layers Names:", a);
// change color mode of document in photoshop
// http://ps-scripts.com/bb/viewtopic.php?f=9&t=3158&start=0
var doc = activeDocument;
var ext= doc.name.toLowerCase().match(/[^\.]+$/);
if(doc.mode !=DocumentMode.CMYK && ext == "tif"){
doc.changeMode(ChangeMode.CMYK);
@jalbertbowden
jalbertbowden / PS_suspendHistory.js
Created February 17, 2019 05:05
How to make one history state in Photoshop
// Suspend history logging so the grid can run as one history state
//
// p - params for renderGuides(). Not used in this method.
//
// Returns void
function execGuideGuide(p){
app.activeDocument.suspendHistory("GuideGuide!", "renderGuides(p)")
}
@jalbertbowden
jalbertbowden / gist:2baa07ad2e8a470da7cbb7bf3471cec8
Created February 17, 2019 05:04 — forked from Arahnoid/gist:6a16c3c813f0bc4c8dca
Photomerge multiple images in Photoshop CC using JavaScript
//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();
@jalbertbowden
jalbertbowden / exportSprites.js
Created February 17, 2019 05:03 — forked from Arahnoid/exportSprites.js
Exports photoshop layers as individual sprites, by Tuba
/*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();
@jalbertbowden
jalbertbowden / export.js
Created February 17, 2019 05:03 — forked from Arahnoid/export.js
Export multiple selected layers from Photoshop with scripting
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],
@jalbertbowden
jalbertbowden / psextendscriptexample.js
Created February 17, 2019 05:03 — forked from Arahnoid/psextendscriptexample.js
Using ExtendScript to save out multiple resolution images from Photoshop (with unsharp mask)
/*
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
@jalbertbowden
jalbertbowden / gist:30be77ef6448ad056b0fd1c937c3c6d7
Created February 17, 2019 05:03 — forked from Arahnoid/gist:3425dbd0211cd2cb4cbc
Photoshop script for get PNG from layer in a group by hide/show one by one.
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]);