Re: Photoshop measure tool
Re: Photoshop measure tool
- Subject: Re: Photoshop measure tool
- From: "Fleisher, Ken" <email@hidden>
- Date: Wed, 15 Nov 2006 13:59:15 -0500
- Thread-topic: Photoshop measure tool
> Yes:
> tell application "Adobe Photoshop CS2"
> set ruler units of settings to inch units
> end tell
Actually, I tried this already. Changing the ruler units to inches had no
effect on the reported coordinates. What did work for me was to change the
ruler units to pixels, which now caused the coordinates to be reported in
pixels. I can then convert to inches or cm based on the current dpi of the
document. So it looks like coordinates for a path can only be reported in
points or pixels.
> Your choice:
> tell application "Adobe Photoshop CS2"
> set point size of settings to postscript size -- 72/inch
> set point size of settings to traditional size -- 72.27/inch
> end tell
I tried this already too. Changing it did not seem to have an effect on the
reported coordinates. This is why I could not figure out what was being
reported in the first place!
> Oops! That¹s my mistake. It appears that you can¹t get the bounds of a
> selection, despite the fact that it¹s in the properties list. Here¹s an
> alternate approach that makes a temporary layer from a rectangular selection
> and gets the bounds of that layer (something that IS possible).
>
> tell application "Adobe Photoshop CS2"
> set foreColor to foreground color
> tell current document
> try non-destructive test that selection exists
> translate boundary selection delta x 0
> on error number 8152 -- there is no selection
> return {0, 0, 0, 0} -- or whatever
> end try
> -- make temporary layer and get its bounds
> set tempLayer to make new art layer
> fill selection with contents foreColor
> set {t, l, b, r} to bounds of tempLayer
> delete tempLayer
> return {t, l, b, r} -- top, left, bottom, right of selection in inches
> end tell
> end tell
>
> Stan C.
Great workaround. Thanks for the tip...
Ken Fleisher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden