Re: Screenshot of Window (using Akua Sweets)
Re: Screenshot of Window (using Akua Sweets)
- Subject: Re: Screenshot of Window (using Akua Sweets)
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Thu, 27 Sep 2001 16:36:21 -0500
on 9/27/01 3:01 AM, Paul Berkowitz at email@hidden wrote:
>
> On 9/27/01 12:15 AM, "Alexander Schrieken" <email@hidden> wrote:
>
> That kind of surprises me since the dictonary
>
> doesn't indicate any of the variables used to be
>
> read only:
>
>
>
> | Properties:
>
> |
>
> | kind button down event/button up event/
>
> | key down event [r/o]
>
> | conglomerate integer [r/o]
>
> | pointer location point
>
> | modifier keys string
>
> | transient keys string
>
> | button down boolean
>
> | caps locked boolean
>
> | raw keys down string [r/o]
>
> | window under mouse string [r/o]
>
> | window coordinates point [r/o]
>
> | window part under mouse small integer [r/o]
>
>
>
I looked again at your original example:
>
>
> Why doesn't this work?
>
>
>
> |tell application "Finder"
>
> | input state {keys down:"4", transient
>
> | keys:"CS", caps locked:true}
>
> |end tell
>
>
Maybe it's because you're using 'transient keys' where you should be using
>
'modifier keys'?
>
>
I'm in OS X at the moment so I can't test it.
I found that it doesn't matter, although I do think modifier keys would be
correct. Akua's dictionary leads one to believe that the modifier and
transient keys are NOT [r/o] and my tests found that command, option,
control, and shift CAN be set using "input state", however caps lock does
not work. Here's how I came to that conclusion. I launched the script titled
Input State that was provided with the AKUA sweets scripts package. The
input state of caps lock [on] returns "A" under modifier keys. Using that
info I tried the following statements:
input state {pointer location:{x, y}, keys down:"4", modifier keys:"CSA",
button down:true}
pause 5
input state {button down:false}
You would think this would work, but it didn't.
I tried various ways {modifier keys:"A",transient keys:"CS"}. I tried
rearranging the order "ACS", "SAC" even re-arranged the order of record
items... nothing worked!
My conclusion is that it can only read the input state of caps lock and not
set it. Therefore it can only be done using the input state method if the
caps lock key is in reality - activated. Plus you have to simulate a full
click (down then up ) because to take a screenshot of a window one must
first click the window. It is on the release of the mouse (up state) that
the event actually takes place.
Greg, from Akua, provided an alternative method, but I'm having trouble with
it so far. Maybe he can confirm my suspicions about modifier key "A"
_bob