Check is phone registered in iMessage

谁都会走 提交于 2019-12-06 11:45:50

You could get the color of the button moving the mouse pointer on it and then scripting the application Digital Color Meter. First calculate the x and y position of the button based on some gui element on the iMessage window, using the position and size attributes.
Then move the pointer to the calculated position:

do shell script "/usr/bin/python -c \"import objc;bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework');objc.loadBundleFunctions(bndl, globals(), [('CGWarpMouseCursorPosition', 'v{CGPoint=dd}')]);CGWarpMouseCursorPosition((" & x & "," & y & "));\""

Use Digital Color Meter to get the color of the pixel pointed, in rgb format:

tell application "Digital Color Meter" to activate
tell application "System Events"
    tell process "Digital Color Meter"
        click menu item 1 of menu 1 of menu bar item 4 of menu bar 1
        delay 1
    end tell
    set rgbColors to words of (the clipboard)
end tell
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!