Saturday, July 4, 2020

#51 2020-05-10 02:22:54 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 4533

Re: Paste text to last active window

Thank you.

Now the contents of the static text is modified.
I don't know why after keystroking "applescript" the field become "Applescript" but maybe there  such formatting at work in the application.

It seems that there was again a silent update because in the history embedder in the message # we may read:

--> "Optional"
    get class of every UI element of group 6 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> {button, group}
end tell
Result:
{button, group}

which prove that there was  a 6th group containing the UI elements : --> {button, group}

Today we may read :

"
    get value of static text 1 of group 1 of text area 1 of group 1 of group 5 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> "AppleScript"
    display dialog"
    get value of static text 1 of group 1 of text area 1 of group 1 of group 5 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> "AppleScript"
    display dialog "oldValue1 = Optional, newValue1 : Optional, altValue1 : AppleScript"
        --> {button returned:"OK"}
    get class of every UI element of group 6 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> error number -1719 from window 1 of process "Salary" whose subrole = "AXFloatingWindow"
end tell
        --> {button returned:"OK"}
    get class of every UI element of group 6 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> error number -1719 from window 1 of process "Salary" whose subrole = "AXFloatingWindow"
end tell


which prove:
(a) that the static text was modified: by the keystroke action (but it wasn't by the paste one)
I will edit the script accordingly.
    display dialog "oldValue1 = Optional, newValue1 : Optional, altValue1 : AppleScript"
     newValue1 confirm that set value did nothing
     altValue1 confirm that the original value was replaced by "Applescript"
I'm curious to learn if you get an uppercase if you type "applescript" by hand.

(b) and prove that the group 6 which was available in message #47 is gone.
    get class of every UI element of group 6 of UI element 1 of scroll area 1 of group 1 of group 1 of window 1 of process "Salary" whose subrole = "AXFloatingWindow"
        --> error number -1719 from window 1 of process "Salary" whose subrole = "AXFloatingWindow"

Clearly your developer is unfair which doesn't warn you when he introduce changes in the structure of the window.
Happily such change was trapped by a  try / end try block but I must say that if I had to work with such a developer, he would ear how I can react to such flippancy.

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) dimanche 10 mai 2020 10:22:46

Last edited by Yvan Koenig (2020-05-10 02:26:39 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)