On 10/24/00 10:14 PM, "Dan Crevier" <[EMAIL PROTECTED]> wrote:
> On 10/24/2000 10:08 PM, "Paul Berkowitz" <[EMAIL PROTECTED]> wrote:
>
>> On 10/24/00 9:55 PM, "Dan Crevier" <[EMAIL PROTECTED]> wrote:
>>
>>> Getting rid of the delay 1 would probably work...
>>
>> �unless it makes it worse. A continuous repeat will eat up thousands of CPU
>> cycles.
>
> Thousands of CPU cycles at hundreds of MHz doesn't add up to much :-) In
> this case, I think the script won't actually get much time to run while the
> calendar is opening, and as soon as it opens, the script will stop sucking
> time. All it can do is make the window open more slowly.
>
Not surprisingly, Dan is right. I couldn't really test this in the exact
situation, since puppet menu worked for me anyway without extra tricks, but
I just had a similar situation with keypress emulation (Sigma's 'type
text').
Using an empty repeat loop to wait for a window to open before doing menu or
keypress emulation does the trick. I just used it to wait for a note window
to open before using
type text "ac" holding down command
to select and copy all in this note window. The empty repeat loop waited
just long enough (a split second) to get the keypress emulation working in
the correct window. ( I wanted to copy preserving HTML formatting.)
On the other hand, closing a window, or doing anything else, _after_ the
emulation is a much dicier thing. I can't find anything that will work
reliably to allow the really slow (by AS standards) emulation command to
finish before the script moves on to the next thing. So the keypress or menu
emulation never happens if there's another command after, since the script
knows it's already sent out the emulation command and moves on to the next
command, but by the time the keyboard AppleEvent gets around to trying to do
its stuff, it discovers there's a script being run by Entourage and won't do
it. AFAIK, the only way to do this reliably is from an applet launched in
the background. Then Entourage doesn't prevent the the keyboard or menu
emulation stuff from working because the script is outside its control. (The
script from within Entourage that calls the outside applet has to say
"ignoring application responses" when it does so.)
--
Paul Berkowitz
--
To unsubscribe: <mailto:[EMAIL PROTECTED]>
To search the archives:
<http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>