Created
February 2, 2012 03:26
-
-
Save moluapple/1721220 to your computer and use it in GitHub Desktop.
[Indesign] ResizeImage_BT_PS
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
// 调用PhotoShop按照Indesign中尺寸修改图像大小 | |
Main(); | |
function Main() { | |
var image = app.selection[0].images[0]; | |
var imagePath = image.itemLink.filePath; | |
var hScale = image.horizontalScale; | |
var vScale = image.verticalScale; | |
CreateBridgeTalkMessage(); | |
function CreateBridgeTalkMessage() { | |
var bt = new BridgeTalk(); | |
bt.target = "photoshop"; | |
bt.body = myResizeImage.toSource() + "('" + imagePath + "'," + hScale + "," + vScale + ");"; | |
bt.send(); | |
} | |
} | |
function myResizeImage(imagePath, hScale, vScale) { | |
var myFile = new File(imagePath); | |
var myDoc = app.open(myFile); | |
myDoc.resizeImage(myDoc.width.value * hScale / 100, myDoc.height.value * vScale / 100, 300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment