Article View: adobe.photoshop.scripting
Article #241Re: Filenames are numerical code- need last four #'s to be the first four #'s
From: christoph_pfaffenbichler
Date: Tue, 24 Mar 2009 09:11
Date: Tue, 24 Mar 2009 09:11
31 lines
1232 bytes
1232 bytes
This might help:
var theFolder = Folder.selectDialog("select the folder containing the images with paths");
if (theFolder) {
var theFiles = theFolder.getFiles();
for (var m = 0; m < theFiles.length; m++) {
var theName = theFiles[m].name;
var theLastNumbers = theName.slice( theName.lastIndexOf("_") + 1, -4);
var theRest = theName.slice(0, theName.lastIndexOf("_"));
theFiles[m].rename(theLastNumbers + "_" + theRest + ".jpg")
}
};
else {
alert ("no selection")
};
use it at Your own risk
Technical Details
Message-ID:
<59b863d7.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b863d7.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,e42e368af880f5c9 X-Google-Attributes: gidf5839,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: christoph_pfaffenbichler@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.photoshop.scripting Subject: Re: Filenames are numerical code- need last four #'s to be the first four #'s Message-ID: <59b863d7.0@webcrossing.la2eafNXanI> Date: Tue, 24 Mar 2009 02:11:46 -0700 References: <59b863d7.-1@webcrossing.la2eafNXanI> Lines: 20 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit