On Feb 29, 2016, at 04:36, Dave <email@hidden> wrote:
What am I doing wrong in my Script to make it return the wrong class?
______________________________________________________________________
Hey Dave,
Making it too complicated to debug? :)
Once you reduce a window to its ID you lose information.
-------------------------------------------
tell application "Microsoft Outlook" set frontWindow to the front window set frontWindowClass to class of frontWindow
--> main window
set winID to id of front window set classOfWinID to class of window id winID
--> window
end tell -------------------------------------------
Be careful when working with multiple windows.
With 1 draft window open I get this:
{ draft window id 358 of application "Microsoft Outlook", main window id 353 of application "Microsoft Outlook", window id -1 of application "Microsoft Outlook", window id -1 of application "Microsoft Outlook", window id -1 of application "Microsoft Outlook", window id -1 of application "Microsoft Outlook", window id -1 of application "Microsoft Outlook" }
From this script:
tell application "Microsoft Outlook" windows end tell
To get around that I had to do this:
tell application "Microsoft Outlook" windows whose visible is true end tell
-- Best Regards, Chris
|