View Full Version : Wildcards in actions
kookookrayzy 09-07-2009, 05:51 AM Hi folks,
I'm trying to make a Save As Jpeg action that saves a flat copy of my layered psd as a jpeg; the save as dialog wants to label it Untitled-1.jpg by default. I don't want it to ask, I just want it to save with some sort of automatic and increasing number, maybe using date/time.
I know I can renumber in Bridge; I just want to save out from Photoshop without having to stop and rename every jpg. I also want it to save in the document's current folder ( like using .. In unix). Any help folks?
Thanks in advance!
Kook
|
|
mordecaidesign
09-08-2009, 06:33 PM
Steve,
I am currently working on this. I have a working action that uses the current date and time and adds it to the beginning of the file. Example: 09082009081555_painting.psd I've had to put this and my other Photoshop scripts/actions on the shelf because I'm trying to finish my portfolio/demo reel and a freelance project.
Let me know if you'd like to be a tester. I'll send you this action and additional actions for iterative file save. My only request is that you tell other people about it when I get ready to sell these actions.
-Matt
kookookrayzy
09-08-2009, 07:39 PM
Cool Matt, thanks, I'll be a guinea pig!
If I can figure out how you did the date renaming, maybe I can offer other ideas.
I'll PM you with my email address if needed.
Thanks again,
-Steve
berniebernie
09-21-2009, 06:59 PM
here's a script i wrote a while ago for cs3...
it looks in the doc folder for pngs with 'filename__####', adds to the #### or starts at 0001 if none found, saves a copy.
as mentioned, only tested on vista+cs3
edit: you should bind that script to a hotkey via an action... which makes an incremental snapshot at a push of a button
// incrementalsave.jsx
//
// checks if there is a double underscore in filename, if not adds them starting at 0001
// else increments and saves as 24bit png (filename__####.png) in the doc's folder
//
//
// feel free to use & modify - mbernadat@gmail.com
//
//
// only tested on vista+cs3
function remEx(f) {
extPeriod = f.lastIndexOf(".");
if(extPeriod > 0){
return f.substr(0,extPeriod);
}else{
return false;
}
}
function getIncrPos(nameWithoutExt){
pos = nameWithoutExt.lastIndexOf("__");
return nameWithoutExt.substr(pos+2,nameWithoutExt.length);
}
function basenameKindOf(path,match) {
a = path.lastIndexOf(match);
if(a > 0){;
return path.substr(a,path.length);
}else{
return false;
}
}
function addZeros(number){
if(number<10){
number = "000"+number;
}else if(number<100){
number = "00"+number;
}else if(number<1000){
number = "0"+number;
}
return number;
}
docP = app.activeDocument.path;
docN = remEx(app.activeDocument.name);
docFold = new Folder (app.activeDocument.path);
files = docFold.getFiles(docN+"__*.png");
files = Folder.decode(files);
if(files.length == 0){
numbering = 0;
}else{
files = files.split(",");
numbering = 0;
for(var i in files){
curNumb = getIncrPos(remEx(basenameKindOf(files[i],docN)));
numbering = Math.max(numbering,curNumb);
//alert("'"+remEx(files[i])+"'");
}
}
numbering++;
numbering = addZeros(numbering);
var exportOptions = new PNGSaveOptions();
//var type = ExportType.PNG24;
var fileSpec = new File(docP+"/"+docN+"__"+numbering+".png");
exportOptions.antiAliasing = true;
exportOptions.transparency = true;
exportOptions.saveAsHTML = false;
app.activeDocument.saveAs(fileSpec,exportOptions,1,Extension.LOWERCASE);
CGTalk Moderation
09-21-2009, 06:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.