Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Created April 8, 2014 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iloveitaly/10139144 to your computer and use it in GitHub Desktop.
Save iloveitaly/10139144 to your computer and use it in GitHub Desktop.
Setup a AppleScript trigger in Messages when a share my screen request is received via AppleScript
tell application "Messages" to activate
delay 3
tell application "System Events"
tell process "iChat"
keystroke "," using command down
click button "Alerts" of tool bar 1 of window 1
delay 0.5
tell group 1 of group 1 of window 1
click pop up button 2
click menu item "Invitation to Share My Screen" of menu 1 of pop up button 2
set applescript_box to checkbox "Run an AppleScript script:"
if not value of applescript_box as boolean then
click applescript_box
end if
set script_menu to pop up button 3
click script_menu
click menu item "AutoAccept.scpt" of menu 1 of script_menu
end tell
end tell
end tell
tell application "Messages" to quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment