![]() This ensures that small images don't get enlarged, which would reduce the quality. If the current document width (accessed through current_document.width) is less than the new width, don't resize. An if statement is wrapped around the resize method. Here's the code: current_document = app.activeDocument Let's modify the code so that any images smaller than the new size won't get resized. Fortunately, JavaScript is a very flexible language! This code works very well at resizing images to 670px (or whatever size you changed it to), but it could be better. Now that you have an understanding of Photoshop Scripts, it's time to improve the code. This can be found in the Presets > Scripts folder of your Photoshop installation. If you would like to see your script in this script menu, then you need to copy it into the appropriate folder. Navigate to your script, and then press open. If you don't want to tie your script to an action, it's even easier to setup. This menu is also where you can edit or delete any scripts previously configured. Go ahead and choose an event, which will trigger your script.
0 Comments
Leave a Reply. |