Title: Re: Selecting "pane" via applescript
On 9/28/03 1:58 AM, "Kirk McElhearn" <[EMAIL PROTECTED]> wrote:

> On 9/28/03 10:50, "Mark and Theresa" <[EMAIL PROTECTED]> wrote:
>
>> I have a Quick Keys action that selects all the messages in the ... Erm ...
>> Message pane (? Top right, not preview or folders!) expands all threads,
>> selects all again, and finally bungs the all into the trash. However I have
>> to select the correct pane first or it threatens to delete a folder!
>
> Does tabbing work?

Tabbing would only work if you knew where you were starting from. Perhaps you could choose the folder first so you'd know how may tabs you had to do.
>
> You don't need to expand threads to delete them - from the keyboard, press
> Command+Option+Delete. I assume you can duplicate this in QuickKeys....

He still has the problem of knowing that the focus is correct.


>> So my idea is to duplicate this script as an applescript, but I cannot work
>> out how to select the appropriate window! Any ideas?

AppleScript doesn't (mostly) work that way: it controls the actual objects (messages, etc.), not their representation on the screen. It has no access to threads. There is a new sort of "GUI scripting" available if you get some special software from Apple, but in Entourage it can't access controls like buttons, only menus. So it could also work the menus but you'd still need to know you had the right focus before you started.

If you want to delete every message in the folder, it's _really_ easy in AppleScript. And you can do it via a keyboard shortcut too.

tell application "Microsoft Entourage"
    try
        set theFolder to displayed feature of main window
        if class of theFolder ≠ folder then error number -128
    on error -- no folder
        beep 2
        return -- quit
    end try
    delete every message of theFolder
end tell



But if you have your View options set to view Unread Only, and then want to delete just these messages after you've read them (with other saved, read messages not involved and still safe in the folder), the proper sort of AppleScript also can't do anything unless you first selected all the messages first - which is what you don't like doing, I gather.


--
Paul Berkowitz

Reply via email to