Photoshop Script Batch Multi Save CHANGE LOG Version 5.3 (240410) a. Adjust UI for right alignment. b. Function 'processFile' break out the excessive sub-functions. c. Not replacing files add 'copy' to new file that would otherwise overwrite. d. New function 'resolveExistingFile' to deconstruct path and add 'copy'. e. Miscellaneous. Version 5.2 (231209) a. Function 'mergeLayers' add unlock all layers. b. Progress increment before display not after. c. Add version to error message. d. Revise function 'mergeLayers' to handle vector masks correctly. e. Miscellaneous. Version 5.1 (230822) a. Set 'folderXxxxxLastValid' once selected. b. Add polyfill String prototype 'trim'. c. Miscellaneous. Version 5.0 (221101) a. New function setFolder climb folder hierarchy until one exists. b. Add script variables 'folderXXXXLastValid'. c. Folder property 'fsName' use 'fullName' instead. d. Function getFiles add WEBP to known Photoshop extensions. Version 4.9 (221021) a. Function mergeLayers handle vector masks. b. Function mergeLayers incorporate rasterizeLayers as sub-function. c. Folder objects create in btnOK.onClick. d. Preserve and restore input and output folders. e. Settings save dialog add include input/output folders. f. Settings function 'remove' delete excess 'this.last'. g. Function getFiles add block ignore EPS if not raster. h. Select input and output folders add current location. i. Function outputFiles rename 'folderFullName' => pathOutput. j. Adopt updated output file object creation and var naming. k. New function setPathOutput. l. Default 'subfolders' change to false. m. Log contents add trailing return. n. Miscellaneous. Version 4.8 (221013) a. Remove useless function xmpRemoveProfile. b. Miscellaneous. Version 4.7 (221012) a. Settings update remove extra blank entry added. Version 4.6 (221009) a. Remove //@target b. Check app name and warn if wrong app for script. c. Remove extra item in drop-down lists. d. Function outputFiles rename var 'fileOut' => 'fileOutput'. e. Update panel 'Settings' to match others. f. Miscellaneous. Version 4.5 (220804) a. Bring to front and close progress at script end. b. Close button false has no effect in Photoshop. c. Correct getFiles() comment. d. JPG save options add matte and scans. e. Log new function addFile to replace logAddFileMessage. f. Replace function logAddFileMessage2 by passing array to log.addFile. g. Replace function notify with alert and confirm. h. Use doneMessage instead of var abort. i. Remove function errorString. j. Settings current break apart single return statement. k. Settings apply and current try/catch/alert errors. Version 4.4 (220708) a. Updated function settings.setList. b. Settings replace list add empty item so minimum two items. c. Settings list add empty item so minimum two items. d. Settings unlock move to listSettings.onChange. Version 4.3 (220614) a. Validate suffix consistent verbiage "Illegal characters removed". b. Throw error "User cancel" instead of "cancelled". c. Equals or not null make strict comparison. d. Vector options call changeOptions only if values don't match. Version 4.2 (220611) a. Add option original file name + (add suffix). Version 4.1 (220523) a. Remove function testCancel. Not necessary. b. Test error 'User cancel' instead of 'User cancelled'. c. Set doneInfo and doneMessage to empty strings prior to process. d. Update doneMessage, doneInfo, and notify logic. e. Log.path set to String not Folder object. f. Update regex for baseName. Version 4.0 (220503) a. Function maxPixels pass actual text value, make args w, h. b. DialogModes.NO once processing. Version 3.9 (220426) a. Last change to DialogModes.ERROR displays error when appMenuItem('selectNoLayers'). Version 3.8 (220426) a. Add DialogModes.ERROR at begin of script. b. Remove DialogModes.ALL. c. Write log to output folder. Version 3.7 (220406) a. Updated function loadColorProfiles. b. Updated function validateNumeric, only for consistency (this script only used for integers). c. Function validatePixels allow decimal mark even though converts to integer. d. Save PNG set compression 5, interlaced false. Version 3.6 (220307) a. Drop down lists make array third argument instead of in properties object. b. Validate functions pass uiEdit argument. c. Do not call changeOption() inside validate functions. d. NEW progress window. e. Add variable abort for failure/cancel messages. f. Settings file encoding UTF-8. g. NEW function getFiles. h. Pass to getFile extensions a string using pipes instead of array. i. Miscellaneous. Version 3.5 (220111) a. Hoist var log. b. Hoist var settings. c. Function setList/listSelection rename control => uiList d. Function maxPixels rename uiControl wide/high => uiEdit wide/high e. Function validateNumeric rename control => uiEdit f. Function validatePixels add comment and disallow either decimal mark. Version 3.4 (211212) a. Apply settings implement function getProp. b. Apply settings updated setList function. c. Miscellaneous. Version 3.3 (211130) a. Set log.path immediately before log.write(). Version 3.2 (211130) a. Update function notify. b. Rename and update function validateNumeric to validatePixels. Special case allows empty string meaning ignore. c. Add function (new version) validateNumeric for PPI. d. DISABLE app.refresh() after open so current image is drawn (version 2.2). Done to improve performance on Mac. Windows shows image either way. e. Miscellaneous. Version 3.1 (211029) a. Fix JPG quality drop down list not wide enough to show 2 digits. Version 3.0 (211029) a. Preserve preferences inside process function. b. Remove natural sort. Not necessary. c. Make JPEG quality a drop down list. d. Miscellaneous. Version 2.9 (211017) a. Updated settings code. b. Miscellaneous. c. Extensions valid don't OR defaultSettings. Could be empty string. d. New setList function. e. listCrop, listMode default to first item instead of null. f. Max pixels ppi assign default value 300. Version 2.8 (210927) a. Update settings load function + other miscellaneous. Version 2.7 (210917) a. Miscellaneous. Version 2.6 (210916) a. Remove support message with email address. b. Log save move this.file.close() to finally. c. Settings load/save move file.close() to finally. Version 2.5.4 (210804) a. Change resample method to bicubic sharper instead of automatic. Makes script compatible with CS6. Besides, better choice anyway. Version 2.5.3 (210801) a. Fix poor PNG resize quality; make 8-bit after resize not before. b. New function adjustPpi. Version 2.5.2 (210711) a. Solution to null userData makes new problem. Some users have MyDocuments on a server. Only use new solution if userData returns "/Volumes/null", rather than always. Rather than 'myDocuments', use value for 'desktop'. Version 2.5.1 (210628) a. Keep paths dialog remove font reduction for macOS. Version 2.5 (210623) a. Save settings add replace option. b. Fix typos. c. Fix eps open options typo property constrainProportions Version 2.4.2 (210608) a. Fix settings file error userData is null. Use documents and replace path. Version 2.4.1 (210321) a. Alert and confirm supply all arguments. Version 2.4 (210125) a. getFiles implement natural sort. Version 2.3.2 (201013) (NOT PUBLISHED) a. Remove excess after JSON code. Version 2.3.1 (200906) a. PNG and untagged JPG ensure profile is removed. b. PNG-8 do not convert color if already indexed color. Version 2.3 (200904) a. Select layer prior to apply mask. b. Fix broken option PNG-8. Version 2.2 (200831) a. Add app.refresh() after open so current image is drawn. b. Remove legacy settings. c. Merge layers select layer before rename. d. Remove excess colorProfileNames.indexOf(). e. Revise closeWasNotOpen function to preserve unsaved docs. f. Miscellaneous. Version 2.1.2 (191220) a. Fix window button return value problem with Windows close button. Version 2.1.1 (190911) a. Update progress window in message function. Version 2.1 (190902) a. Miscellaneous. Version 2.0.1 (190624) a. Miscellaneous. Version 2.0 (190510) a. Revise logging. b. Revise settings. c. Custom alert/notify window with open log button. d. Restore altered app preferences on completion. e. Add option keep paths by name. f. Add option keep first path. g. Add option save vector masks as path and keep all. h. Repair flaws in handling shape layers and vector masks. i. Discarding paths no longer disables layers as-is. j. PNG no longer use Save For Web, regular save instead. k. Better handle user cancel. l. Miscellaneous. Version 19.4.3 (1.7) a. Fix disabled layer mask being applied. b. Recognize and properly handle vector masks. Version 19.3.8 (1.6.4) a. Add license. Version 19.2.24 (1.6.3) a. Update settings file error handling. b. Miscellaneous. Version 19.2.21 (1.6.2) a. Max pixels scale both width and height (prior width only). b. Miscellaneous. Version 19.1.5 (1.6.1) a. Fix logging error, full name of unsaved file undefined. b. Miscellaneous. Version 18.12.10 (1.6) a. Move log.write() outside process loop. b. Progress message and increment to outermost loop. c. Update open error message. d. Optimize building profile list. e. Revise settings object. f. Revise log object. g. Miscellaneous. Version 18.12.6 (1.5) a. Hard code gray profiles Dot Gains and Gammas. b. Remove guides except when layers as-is. c. Handle 16- and 32-bit images. d. 8 bits per color if convert to profile. e. JPG always 8 bits per color (24-bit RGB). f. PNG always 8 bits per color (24-bit RGB) before save as 8 or 24. g. Test for duplicate baseName, add back extension. h. Reorder transformations: layers, color, ppi, max pixels, then paths. i. Disable layers as-is if resample, limit pixels, or alter paths. j. UI alignment adjustments. Version 18.12.1 (1.4) a. Handle odd formats, bitmap, duotone, spot colors, multichannel. b. PNG use Save For Web, add options PNG-8 / PNG-24. Version 18.11.29 (1.3) a. Revise vector options, rename PDF/AI/EPS options. b. Add to vector options choice for PDF images. c. Rename for web include replacing underscore. d. Save as PNG omit profile. Version 18.11.27 (1.2) a. Revise getFiles() function for hidden files/other refinements. b. Add vector options to process AI, PDF, and vector EPS. c. Miscellaneous. Version 18.11.23 (1.1) a. Add keep paths, only clipping, or discard all. b. Ignore some extensions we know Photoshop won't open. Version 18.11.21 (1.0) a. Initial release.