set position

This area contains the messages from the old Yahoo gcmac group after the port.
Post Reply
Robert Poland
Posts: 0
Joined: Sun Jan 03, 2010 3:45 pm

set position

Post by Robert Poland »

Thorsten,Shouldn't this script work?Gives error "AppleEvent handler failed."tell application "GraphicConverter" activate delay 1 tell window 1 delay 1 set position to {22, 22} end tellend tellRobert PolandGC 8.1 (880)2.7 GHz Intel Core I5, 27” iMac  12 GB Ram, 1TB HD, OS 10.7.4
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: set position

Post by Christopher Stone »

On May 27, 2012, at 17:50, Robert Poland wrote: Shouldn't this script work?______________________________________________________________________Hey Bob,Something is distinctly broken.tell application "GraphicConverter" set w to front window name of w -- Works position of w -- Fails resolution of w -- Fails properties of w -- Failsend telltell application "GraphicConverter" name of front window -- Works position of front window -- Fails resolution of front window -- Fails properties of front window -- Failsend tell--Best Regards,Chris
Robert Poland
Posts: 0
Joined: Sun Jan 03, 2010 3:45 pm

Re: set position

Post by Robert Poland »

On May 28, 2012, at 2:11 PM, Christopher Stone wrote:On May 27, 2012, at 17:50, Robert Poland wrote:Shouldn't this script work?__________________________________________________________________ ____Hey Bob,Something is distinctly broken.tell application "GraphicConverter" set w to front< span style="color: #000000"> window name of w -- Works position of w -- Fails resolution of w -- Fails properties of w -- Failsend telltell application "GraphicConverter" name of front window -- Works position of front window -- Fails resolution of front window -- Fails properties of front window -- Failsend tell--Best Regards,ChrisThese work;tell application "GraphicConverter" activate set windowName to name of window 1 tell window 1 set currentResolution to resolution as text --  set position to {1, topMargin} -- fails set topMargin to 22 set {leftSide, topSide, rightSide, bottomSide} to bounds set rightSide to rightSide - leftSide set bottomSide to bottomSide - topSide + topMargin set leftSide to 1 set topSide to topMargin set bounds to {leftSide, topSide, rightSide, bottomSide} end tellend tell Robert Poland - Fort Collins, CO
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: set position

Post by Christopher Stone »

On May 28, 2012, at 15:28, Robert Poland wrote: set currentResolution to resolution as text______________________________________________________________________Hey Bob,You don't really want to get the resolution as text do you?  (Since it's two values, and as text concatenates them.)--Best Regards,Chris
Robert Poland
Posts: 0
Joined: Sun Jan 03, 2010 3:45 pm

Re: set position

Post by Robert Poland »

On May 28, 2012, at 3:40 PM, Christopher Stone wrote:On May 28, 2012, at 15:28, Robert Poland wrote:set currentResolution to resolution as text___________ ___________________________________________________________Hey Bob,You don't really want to get the resolution as text do you?  (Since it's two values, and as text concatenates them.)--Best Regards,ChrisNot sure but this has been working for some time; tell window 1 -- Main window set alpha channel to false -- remove alpha channel set currentResolution to resolution as text -- don't do greater than 300 if currentResolution > newResolution then repeat while resolution ≠ newResolution change resolution to newResolution delay 0.1 -- need time end repeat end if Robert Poland - Fort Collins, CO
Christopher Stone
Posts: 0
Joined: Sat Jun 19, 2004 11:47 pm

Re: set position

Post by Christopher Stone »

On May 28, 2012, at 16:48, Robert Poland wrote: On May 28, 2012, at 3:40 PM, Christopher Stone wrote:You don't really want to get the resolution as text do you?  (Since it's two values, and as text concatenates them.)Not sure but this has been working for some time; tell window 1 -- Main window set alpha channel to false -- remove alpha channel set currentResolution to resolution as text -- don't do greater than 300 if currentResolution > newResolution then repeat while resolution ≠ newResolution change resolution to newResolution delay 0.1 -- need time end repeat end if______________________________________________________________________Hey Bob,You don't show what newResolution is.It doesn't work for me if it's an integer; I have to do something like:tell application "GraphicConverter" tell window 1 change resolution to {300, 300} resolution end tellend tell--> {300, 300}If I just get the resolution as text without changing TIDs the result is 7272 for a 72x72 dpi image.--Best Regards,Chris
Robert Poland
Posts: 0
Joined: Sun Jan 03, 2010 3:45 pm

Re: set position

Post by Robert Poland »

On May 28, 2012, at 4:12 PM, Christopher Stone wrote:On May 28, 2012, at 16:48, Robert Poland wrote:On May 28, 2012, at 3:40 PM, Christopher Stone wrote:You don't really want to get the resolution as text do you?  (Since it's two values, and as text concatenates them.)Not sure but this has been working for some time; tell window 1 -- Main window set alpha channel to false -- remove alpha channel set currentResolution to resolution as text -- don't do greater than 300 if currentResolution > newResolution then repeat while resolution ≠ newResolution change resolution to newResolution delay 0.1 -- need time end repeat end if______________________________________________________________________Hey Bob,You don't show what newResolution is. set newResolution to {300, 300}It doesn't work for me if it's an integer; I have to do something like:tell application "GraphicConverter" tell window 1 change resolution to {300, 300} resolution end tellend tell--> {300, 300}If I just get the resolution as text without changing TIDs the result is 7272 for a 72x72 dpi image.--Best Regards,Chris Robert Poland - Fort Collins, CO
Post Reply