Recent infos.
I was contacted by Daylite support.
It’s surprising but it appeared that the Mailbutler version which I downloaded was not the more recent one so I downloaded again and this time I got version 2819 (13559).
It continue to conflict with Daylite version 2020.13 (5294).
With only MailButler installed the GUI of the message window is different from the one reported in message #6.
Here is a script matching the new GUI.
tell application "Mail"
--activate
set x to "vcq-PD-mON.title"
set to_loc to localized string x from table "ShareViewController"
end tell
if to_loc = x then set to_loc to "To:"
-- In Deutch it's "An:"
if (system attribute "sys2") as integer = 13 then set to_loc to "À :" -- to work on YK's imac
--------------------------------------------------------------------------------------------------
tell application "System Events"
set theProcesses to name of processes
tell process "Mail"
set frontmost to true
if theProcesses contains "MailButler" then
tell window 1
class of UI elements ---> {splitter group, button, button, button, toolbar, group}
tell splitter group 1
class of UI elements --> {static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, group, scroll area, pop up button, static text, splitter, group, group, group, group, radio group}
name of text fields --> {"À :", "Cc :", "Cci :", "Répondre à :", "Objet :"}
value of text fields --> {"petit papa noël", "", "", "", ""}
tell text field to_loc
class of UI elements --> {}
set theToRecipient to its value --> "petit papa noël"
if ((count words of theToRecipient) ≥ 0) then
if theToRecipient contains "," then
return word 2 of theToRecipient
else
return word 1 of theToRecipient --> "petit"
end if
end if
end tell
end tell
end tell -- window 1
else
tell window 1
class of UI elements --> {static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, scroll area, pop up button, static text, button, button, button, toolbar, group}
name of text fields --> {"À :", "Cc :", "Cci :", "Répondre à :", "Objet :"}
value of text fields --> {"petit papa noël", "", "", "", ""}
tell text field to_loc
class of UI elements --> {}
set theToRecipient to its value --> "petit papa noël"
if ((count words of theToRecipient) ≥ 0) then
if theToRecipient contains "," then
return word 2 of theToRecipient
else
return word 1 of theToRecipient --> "petit"
end if
end if
end tell -- text field
end tell -- window 1
end if
end tell
end tell -- System Events
--------------------------------------------------------------------------------------------------
Which may be shortened as :
tell application "Mail"
--activate
set x to "vcq-PD-mON.title"
set to_loc to localized string x from table "ShareViewController"
end tell
if to_loc = x then set to_loc to "To:"
-- In Deutch it's "An:"
if (system attribute "sys2") as integer = 13 then set to_loc to "À :" -- to work on YK's imac
--------------------------------------------------------------------------------------------------
tell application "System Events"
set theProcesses to name of processes
tell process "Mail"
set frontmost to true
if theProcesses contains "MailButler" then
set target to splitter group 1 of window 1
else
set target to window 1
end if
tell target
class of UI elements
-- without MailButler
--> {static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, scroll area, pop up button, static text, button, button, button, toolbar, group}
-- with MailButler
--> {static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, button, static text, text field, group, scroll area, pop up button, static text, splitter, group, group, group, group, radio group}
name of text fields --> {"À :", "Cc :", "Cci :", "Répondre à :", "Objet :"}
value of text fields --> {"petit papa noël", "", "", "", ""}
tell text field to_loc
class of UI elements --> {}
set theToRecipient to its value --> "petit papa noël"
if ((count words of theToRecipient) ≥ 0) then
if theToRecipient contains "," then
return word 2 of theToRecipient
else
return word 1 of theToRecipient --> "petit"
end if
end if
end tell -- text field
end tell -- window 1
end tell
end tell -- System Events
--------------------------------------------------------------------------------------------------
Again, the found GUI doesn’t match the one triggered by ChristophWi in its original message.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) samedi 23 mai 2020 19:33:31