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.
-------------------------------------------
tellapplication"Microsoft
Outlook"
set frontWindowto
thefront
window
setfrontWindowClass
toclassoffrontWindow
--> main window
set winIDto
idof
frontwindow
setclassOfWinID
toclassofwindowidwinID
--> window
end tell
-------------------------------------------
Be careful when working with multiple windows.
With 1 draft window open I get this:
{
draft windowid
358 of
application"Microsoft Outlook",
main windowid
353 of
application"Microsoft Outlook",
windowid
-1 of
application"Microsoft Outlook",
windowid
-1 of
application"Microsoft Outlook",
windowid
-1 of
application"Microsoft Outlook",
windowid
-1 of
application"Microsoft Outlook",
windowid
-1 of
application"Microsoft Outlook"
}
From this script:
tellapplication"Microsoft
Outlook"
windows
end tell
To get around that I had to do this:
tellapplication"Microsoft
Outlook"
windowswhosevisible
istrue
end tell
--
Best Regards,
Chris