How it works now
I have folders on my desktop labeled
Design_WKxxDone
Free_WKxxDone etc.
XX being the current week.
I drag this onto a photoshop droplet that corresponds to the folder name, so Design_WKxxDone would be placed over the Design droplet. ( I press and hold alt this gives me a prompt to enter the week number. Then it runs copying the images down to various locations in different sizes.
See the PS-Script below is the droplet script that it runs, I’m not looking to alter this script as I have a number like it.
The normal method of running this script is that by holding the alt key allows you to input the week if you don’t it will use the previously used week. This then chucks the images into various folders using the week number (this would be the same as the one used in the fore mentioned folder. Design_WKxxDone
There are a number of request I am asking.
I would like to be able to have an onscreen windows where I can load up all the folders that need to be processed
So folder A using Droplet A
Folder B using Droplet B etc.
It would need to take the Week number from the folder name (it would always be the only number in the folder name it would follow after WK in the folder name). run the dropets sequencially (as photoshop will only allow one after another) and Ideally a schedule time so I can let it run over night, alternatively I set it to run as the last thing that I do in the day.
As some may have seen from using this site, I have very useless knowledge of Applescript and have had a lot of help with my ideas. I am hoping to find someone who can compile this as I would be lost doing it myself. I’ve got my applescript book so I am off to learn but I don’t think I will be compiling anything quite like this just yet.
#target photoshop
//
// Design.jsx
//
//==================== Design ==============
//
Design();
function Design() {
try {
var desc = app.getCustomOptions(“21878580-3f53-11e0-9207-0800200c9a66”);
var userInput = desc.getString(stringIDToTypeID(‘userInput’));
}catch(e) {}
if(undefined == userInput || ScriptUI.environment.keyboardState[‘altKey’] || DialogModes.ALL == app.playbackDisplayDialogs ){
var userInput = prompt(‘Design, Enter Week Number’,‘default input’);
}
if(userInput != null){// make sure the user did not cancel. May want to add other checks such as length
try{
var desc = app.getCustomOptions(“21878580-3f53-11e0-9207-0800200c9a66”);
}catch(e){
var desc = new ActionDescriptor();
}
desc.putString (stringIDToTypeID(‘userInput’) , userInput );
app.putCustomOptions( “21878580-3f53-11e0-9207-0800200c9a66”, desc, true );
var localFolder = new Folder(‘~/Pictures/2011-2012/WK’+userInput+“/Design”);
if(!localFolder.exists) localFolder.create();
var highResFolder = new Folder(localFolder+‘/Design_WK’+userInput+“_HR”);
if(!highResFolder.exists) highResFolder.create();
var networkFolder = new Folder(‘/Volumes/2012/Week’+userInput+‘/Design_WK’+userInput+“_LR”);
if(!networkFolder.exists) networkFolder.create();
var saveName = decodeURI(app.activeDocument.name);
saveName.match(/(.)(.[^.]+)/) ? saveName = saveName.match(/(.)(.[^.]+)/):saveName = [saveName, saveName];
saveName = saveName[1];
// Flatten Image
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(stringIDToTypeID(‘flattenImage’), undefined, dialogMode);
};
// Smart Sharpen
function step2(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(‘#Prc’), 164);
desc1.putUnitDouble(charIDToTypeID(‘Rds ‘), charIDToTypeID(’#Pxl’), 0.9);
desc1.putInteger(charIDToTypeID(‘Thsh’), 0);
desc1.putInteger(charIDToTypeID(‘Angl’), 0);
desc1.putBoolean(stringIDToTypeID(“moreAccurate”), false);
desc1.putEnumerated(charIDToTypeID(‘blur’), stringIDToTypeID(“blurType”), charIDToTypeID(‘GsnB’));
desc1.putString(stringIDToTypeID(“preset”), “Default”);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(‘#Prc’), 0);
desc2.putUnitDouble(charIDToTypeID(‘Wdth’), charIDToTypeID(‘#Prc’), 50);
desc2.putInteger(charIDToTypeID(‘Rds ‘), 1);
desc1.putObject(charIDToTypeID(‘sdwM’), stringIDToTypeID(“adaptCorrectTones”), desc2);
var desc3 = new ActionDescriptor();
desc3.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(’#Prc’), 0);
desc3.putUnitDouble(charIDToTypeID(‘Wdth’), charIDToTypeID(‘#Prc’), 50);
desc3.putInteger(charIDToTypeID('Rds '), 1);
desc1.putObject(charIDToTypeID(‘hglM’), stringIDToTypeID(“adaptCorrectTones”), desc3);
executeAction(stringIDToTypeID(‘smartSharpen’), desc1, dialogMode);
};
// Save
function step3(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var desc2 = new ActionDescriptor();
desc2.putInteger(charIDToTypeID(‘EQlt’), 12);
desc2.putEnumerated(charIDToTypeID(‘MttC’), charIDToTypeID(‘MttC’), charIDToTypeID(‘None’));
desc1.putObject(charIDToTypeID(‘As ‘), stringIDToTypeID(“JPEGFormat”), desc2);
desc1.putPath(charIDToTypeID(‘In ‘), new File(highResFolder+’/’+saveName+’.jpg’));
desc1.putBoolean(charIDToTypeID(‘LwCs’), true);
executeAction(charIDToTypeID(‘save’), desc1, dialogMode);
};
// Select
function step4(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(charIDToTypeID(‘HstS’), charIDToTypeID(‘Ordn’), charIDToTypeID(‘Prvs’));
desc1.putReference(charIDToTypeID(‘null’), ref1);
executeAction(charIDToTypeID(‘slct’), desc1, dialogMode);
};
// Image Size
function step5(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(charIDToTypeID(‘Wdth’), charIDToTypeID(‘#Pxl’), 1000);
desc1.putBoolean(stringIDToTypeID(“scaleStyles”), true);
desc1.putBoolean(charIDToTypeID(‘CnsP’), true);
desc1.putEnumerated(charIDToTypeID(‘Intr’), charIDToTypeID(‘Intp’), charIDToTypeID(‘Bcbc’));
executeAction(stringIDToTypeID(‘imageSize’), desc1, dialogMode);
};
// Smart Sharpen
function step6(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
desc1.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(‘#Prc’), 164);
desc1.putUnitDouble(charIDToTypeID(‘Rds ‘), charIDToTypeID(’#Pxl’), 0.9);
desc1.putInteger(charIDToTypeID(‘Thsh’), 0);
desc1.putInteger(charIDToTypeID(‘Angl’), 0);
desc1.putBoolean(stringIDToTypeID(“moreAccurate”), false);
desc1.putEnumerated(charIDToTypeID(‘blur’), stringIDToTypeID(“blurType”), charIDToTypeID(‘GsnB’));
desc1.putString(stringIDToTypeID(“preset”), “Default”);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(‘#Prc’), 0);
desc2.putUnitDouble(charIDToTypeID(‘Wdth’), charIDToTypeID(‘#Prc’), 50);
desc2.putInteger(charIDToTypeID(‘Rds ‘), 1);
desc1.putObject(charIDToTypeID(‘sdwM’), stringIDToTypeID(“adaptCorrectTones”), desc2);
var desc3 = new ActionDescriptor();
desc3.putUnitDouble(charIDToTypeID(‘Amnt’), charIDToTypeID(’#Prc’), 0);
desc3.putUnitDouble(charIDToTypeID(‘Wdth’), charIDToTypeID(‘#Prc’), 50);
desc3.putInteger(charIDToTypeID('Rds '), 1);
desc1.putObject(charIDToTypeID(‘hglM’), stringIDToTypeID(“adaptCorrectTones”), desc3);
executeAction(stringIDToTypeID(‘smartSharpen’), desc1, dialogMode);
};
// Select
function step8(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putOffset(charIDToTypeID(‘HstS’), -3);
desc1.putReference(charIDToTypeID(‘null’), ref1);
executeAction(charIDToTypeID(‘slct’), desc1, dialogMode);
};
// Select
function step9(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(charIDToTypeID('Lyr '), “Original Image”);
desc1.putReference(charIDToTypeID(‘null’), ref1);
desc1.putBoolean(charIDToTypeID(‘MkVs’), false);
executeAction(charIDToTypeID(‘slct’), desc1, dialogMode);
};
// Select
function step10(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putName(charIDToTypeID('Lyr '), “BACKGROUND”);
desc1.putReference(charIDToTypeID(‘null’), ref1);
desc1.putEnumerated(stringIDToTypeID(“selectionModifier”), stringIDToTypeID(“selectionModifierType”), stringIDToTypeID(“addToSelection”));
desc1.putBoolean(charIDToTypeID(‘MkVs’), false);
executeAction(charIDToTypeID(‘slct’), desc1, dialogMode);
};
// Delete
function step11(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(charIDToTypeID('Lyr '), charIDToTypeID(‘Ordn’), charIDToTypeID(‘Trgt’));
desc1.putReference(charIDToTypeID(‘null’), ref1);
executeAction(charIDToTypeID('Dlt '), desc1, dialogMode);
};
// Merge Visible
function step12(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(stringIDToTypeID(‘mergeVisible’), undefined, dialogMode);
};
// Set
function step13(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(charIDToTypeID('Lyr '), charIDToTypeID(‘Ordn’), charIDToTypeID(‘Trgt’));
desc1.putReference(charIDToTypeID(‘null’), ref1);
var desc2 = new ActionDescriptor();
desc2.putString(charIDToTypeID('Nm '), “Layer 0”);
desc1.putObject(charIDToTypeID('T '), charIDToTypeID('Lyr '), desc2);
executeAction(charIDToTypeID(‘setd’), desc1, dialogMode);
};
// Save
function step13a(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var desc2 = new ActionDescriptor();
desc2.putEnumerated(stringIDToTypeID(“PNGInterlaceType”), stringIDToTypeID(“PNGInterlaceType”), stringIDToTypeID(“PNGInterlaceNone”));
desc2.putEnumerated(stringIDToTypeID(“PNGFilter”), stringIDToTypeID(“PNGFilter”), stringIDToTypeID(“PNGFilterAdaptive”));
desc1.putObject(charIDToTypeID(‘As ‘), stringIDToTypeID(“PNGFormat”), desc2);
desc1.putPath(charIDToTypeID(‘In ‘), new File(networkFolder+’/’+saveName+’.png’));
desc1.putBoolean(charIDToTypeID(‘LwCs’), true);
executeAction(charIDToTypeID(‘save’), desc1, dialogMode);
};
// Close
function step18(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
executeAction(charIDToTypeID('Cls '), undefined, dialogMode);
};
step1(); // Flatten Image
step2(); // Smart Sharpen
step3(); // Save
step4(); // Select
step5(); // Image Size
step6(); // Smart Sharpen
step8(); // Select
step9(); // Select
step10(); // Select
step11(); // Delete
step12(); // Merge Visible
step13(); // Set
step13a(); // Save
step18(); // Close
};
}
// EOF