airmessage / airmessage-server

AirMessage's native message relay server for Mac
Apache License 2.0
183 stars 12 forks source link

Arbitrary delay issues with slow macs #4

Open larsdennert opened 2 years ago

larsdennert commented 2 years ago

In get facetime link SEE TEXT IN CAPS. Examine get new facetime link for the same robustness.

ell application "System Events" tell process "FaceTime" --Open sidebar repeat with buttonEl in buttons of window 1 if (exists attribute "AXIdentifier" of buttonEl) and (value of attribute "AXIdentifier" of buttonEl = "toggleSidebarButton") then click buttonEl end if end repeat

    --Wait for sidebar to open
    delay 1 BETTER TO REPEAT TEST FOR EXIST SIDE BAR BUTTON

    --Clear the clipboard
    set the clipboard to ""

    --Click "share link" button BETTER TO INCLUDE THIS IN REPEAT SECTION BELOW IN CASE THE CLICK DIDNT GO
    set linkButton to button 2 of last group of list 1 of list 1 of scroll area 2 of window 1
    click linkButton
    delay 0.1
    click menu item 1 of menu of linkButton

    repeat
        if the clipboard is not ""
            return the clipboard as string
        end if
        delay 0.1
    end repeat
end tell

end tell