Re: Photoshop CS3 : translate selection problem - possibly units?
Re: Photoshop CS3 : translate selection problem - possibly units?
- Subject: Re: Photoshop CS3 : translate selection problem - possibly units?
- From: "James Gretton" <email@hidden>
- Date: Sun, 3 Aug 2008 18:03:35 +0100
To follow up, many hours later I seem to have found a way to fix the
problem. I am now even more unhappy though because either I'm
completely missing something or this is an AppleScript bug! If anyone
can explain why this might be fixing the issue I'd be very grateful!
The fix is to reset the resolution of the file:
tell application "Adobe Photoshop CS3"
set currentDoc to current document
set ruler units of settings to pixel units
-- Reset the resolution --
set res to resolution of currentDoc
resize image currentDoc resolution res
select currentDoc region {¬
{0, 0}, ¬
{0, 10}, ¬
{10, 10}, ¬
{10, 0} ¬
}
translate selection of currentDoc delta x 10
end tell
Now all seems to work fine. Does anyone have any idea why this is?
Thanks,
James
2008/8/3 James Gretton <email@hidden>:
> Hello all, I'm using AppleScript and Photoshop CS3 to perform some
> automated image editing tasks and learning AppleScript at the same
> time.
>
> My problem is with PhotoShops translate command. Below is a simplified script:
>
> tell application "Adobe Photoshop CS3"
>
> set currentDoc to current document
> set ruler units of settings to pixel units
>
> select currentDoc region {¬
> {0, 0}, ¬
> {0, 10}, ¬
> {10, 10}, ¬
> {10, 0} ¬
> }
>
> translate selection of currentDoc delta x 10
>
> end tell
>
> Which should select a 10 x 10 square and move it 10 pixels to the
> right. The selection works fine, however it seems to then move the
> selected area right off the screen.
>
> To translate the selection a few pixels to the right, I can instead do:
>
> translate selection of currentDoc delta x 1.0E-8
>
> Does anyone know what the unit of this 0.00000001 could be, and how I
> can instead ensure this translation is done in pixels?
>
> Many thanks,
>
> James
>
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden