The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Photoshop Script to Change Matte Color
I created a Photoshop script that will open all the PSDs in a folder and Save To Web as .gif using a matte color you specify in hex out to a folder of your choice. You need to specify the hex color in the code around line 52, just put in the value without the preceding "#" sign. Copy and paste the code to into a new text document and save it as <somename>.jsx . Unfortunately, it doesn't do folder traversing so if you have multiple folders it will be necessary to do each folder individually. I created this script especially for use with the vBulletin PSDs for easy matting. It has been tested in Adobe Photoshop CS2. Code below... let me know how you like it. HTML Code:
// enable double clicking from the Macintosh Finder or the Windows Explorer #target photoshop /////////////////////////// // SET-UP // /////////////////////////// // A list of file extensions to skip, keep them lower case gFilesToSkip = Array( "db", "xmp", "thm", "txt", "doc", "md0", "tb0", "adobebridgedb", "adobebridgedbt", "bc", "bct" ); // Pops open a dialog for the user to choose the folder of documents to process var inputFolder = Folder.selectDialog("Select a folder of documents to process"); // Pops open a dialog for the user to set the output folder var outputFolder = Folder.selectDialog("Select a folder for the output files"); /////////////////////////// // MAIN // /////////////////////////// // Open Folder of Images var numFiles = OpenFolder(); /////////////////////////// // FUNCTIONS // /////////////////////////// main(); function main() { if (app.documents.length <= 0) { alert("You must have a document open to Save For Web"); return; } try { for(var i = 0; i < numFiles; i++) { //alert("Save To Web"); RunSaveForWeb(); //alert("Closing"); app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); } } catch (error) { if (error.number != 8007) // Don't report user cancelled errors. alert (error); // + ":" + error.line); } } function RunSaveForWeb() { //Define SaveForWeb Options var matteColorColor = new RGBColor(); matteColorColor.hexValue = "000000"; var sfwOptions = new ExportOptionsSaveForWeb(); sfwOptions.format = SaveDocumentType.COMPUSERVEGIF; sfwOptions.includeProfile = false; sfwOptions.colors = 256; sfwOptions.matteColor = matteColorColor; sfwOptions.interlaced = 0; //Save for Web docPath = outputFolder; docName = activeDocument.name; var temp = new Array(); temp = docName.split('.'); sfwJpgFile = new File(docPath + "\\" + temp[0] + ".gif"); activeDocument.exportDocument(sfwJpgFile, ExportType.SAVEFORWEB, sfwOptions); } // Given the a Folder of files, open them function OpenFolder() { var filesOpened = 0; var fileList = inputFolder.getFiles(); for (var i = 0; i < fileList.length; i++) { // Make sure all the files in the folder are compatible with PS if (fileList[i] instanceof File && ! fileList[i].hidden && ! IsFileOneOfThese(fileList[i], gFilesToSkip)) { open(fileList[i]); filesOpened++; } } return filesOpened; } // given a file name and a list of extensions // determine if this file is in the list of extensions function IsFileOneOfThese( inFileName, inArrayOfFileExtensions ) { var lastDot = inFileName.toString().lastIndexOf("."); if (lastDot == -1) { return false; } var strLength = inFileName.toString().length; var extension = inFileName.toString().substr(lastDot + 1, strLength - lastDot); extension = extension.toLowerCase(); for (var i = 0; i < inArrayOfFileExtensions.length; i++ ) { if ( extension == inArrayOfFileExtensions[i] ) { return true; } } return false; } |
#2
|
|||
|
|||
What a great idea!
-Kether |
#3
|
|||
|
|||
This is exactly what I've wanted for ages.
The problem for many users is that the standard vBulletin images (buttons, smilies, status icons, etc.) are all matted to a white background (the vBulletin standard out-of-box style). When it comes to changing your style to a darker colour (black, or blue, etc.) all the images tend to show a fine white border around them, that is most off-putting. What you have done with this article is provided users a way of keeping their standard vBulletin images (I actually prefer them to the crap that's out there...), without having to keep the standard vBulletin style (which isn't the best in the world). The only problem users have now is getting a copy of Photoshop CS2 +. If I could buy you a pint, I would. Thx :-D step |
#4
|
|||
|
|||
very nice - thanks! gonna try this out now, was just googling for this exact thing
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|