Created
June 25, 2012 08:48
-
-
Save kuyseng/2987454 to your computer and use it in GitHub Desktop.
javascript: photoshop fit Image width height
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference: http://www.ps-scripts.com/bb/viewtopic.php?f=10&t=3409&sid=f4a754d74f5b92fa6732a283c0e20fd9 | |
function FitImage( inWidth, inHeight ) { | |
var desc = new ActionDescriptor(); | |
var unitPixels = charIDToTypeID( '#Pxl' ); | |
desc.putUnitDouble( charIDToTypeID( 'Wdth' ), unitPixels, inWidth ); | |
desc.putUnitDouble( charIDToTypeID( 'Hght' ), unitPixels, inHeight ); | |
var runtimeEventID = stringIDToTypeID( "3caa3434-cb67-11d1-bc43-0060b0a13dc4" ); | |
executeAction( runtimeEventID, desc, DialogModes.NO ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment