Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Scale Photoshop layer using AppleScript

$
0
0

Obviously, this is a Mac PS issue.

 

I am trying to script scaling a Photoshop layer (a smart object layer) to a specified percentage that I calculate from a layout in InDesign.

However, I am stumped on the syntax I should use to actually get the layer to resize, or perhaps I don't know how to call out the layer properly.

 

Here is my code (it is very simple at this point in time:

 

 

tell application "Adobe InDesign CS6"          set mySelect to selection  --error trap to make sure I have graphic content selected            tell active spread of active window                    set thisBox to item 1 of mySelect                    set HScale to the absolute horizontal scale of thisBox            end tell
end tell
myScaleConversion(HScale)
set PSScaled to result as real

tell application "Adobe Photoshop CS6"
          set thisLayer to current layer of current document          set scaleSet to {horizontal scale:PSScaled, vertical scale:PSScaled, anchor:"top left"}  scale current layer of current document with scaleSet  
end tell


on myScaleConversion(HScale)
          set ScaleRatio to 2.5 as real          set PSScale to (ScaleRatio * HScale)          return PSScale  
end myScaleConversion

 

 

I would appreciate any help with this. I run this script and no error messages occur, but then again, nothing happens to the Photoshop layer I have targeted.


Viewing all articles
Browse latest Browse all 12244

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>