Monday, November 19, 2007

Multiple User Screenshare Applescript

Got a few requests for listing multiple accounts and accepting if any of those show up in the allowed accounts in the applescript. This should work (sorry, i haven't had any time to test this for sure). Same instructions for using as outline in the previous post.


(*


File: Auto Screenshare Multi Accept.applescript


Abstract: An update of Apple's Auto Accept script to allow for automatic screenshare acceptance from a specific buddy. This version allows for multiple accounts to be listed and checks the requesting screen name against the list for verification.

Version: 1.1


Disclaimer: IMPORTANT:  I am not liable for any use of this script. Do not use this script if you are unaware of the potential security issues.


Created By: Graydon Stoner

http://www.getstonered.com


*)


using terms from application "iChat"

on received video invitation theText from theBuddy for theChat

set buddySN to (get name of theBuddy)

set allowedBuddies to {"buddy1@mac.com", "buddy2@mac.com", "buddy3@mac.com"}

set allowScreenShare to false

repeat with curBuddy in allowedBuddies

if (curBuddy is buddySN) then

set allowScreenShare to true

end if

end repeat

if (allowScreenShare is true) then

if (screen sharing of theChat is local screen) then

accept theChat

end if

end if

end received video invitation

on received audio invitation theText from theBuddy for theChat

set buddySN to (get name of theBuddy)

set allowedBuddies to {"buddy1@mac.com", "buddy2@mac.com", "buddy3@mac.com"}

set allowScreenShare to false

repeat with curBuddy in allowedBuddies

if (curBuddy is buddySN) then

set allowScreenShare to true

end if

end repeat

if (allowScreenShare is true) then

if (screen sharing of theChat is local screen) then

accept theChat

end if

end if

end received audio invitation

end using terms from

2 comments:

Anonymous said...

The single user script works wonderfully, but for some reason the multi user script doesn't want to work.

It seems that it has trouble with setting the allowed buddies if there is more than one variable in the list (i.e. within the { } )

Thanks for this great script! Please take the time to fix the bug in the multi user one.

Jay Goodman Tamboli said...

I was able to solve the above commenter's problem by changing the lines which read "if (curBuddy is buddySN) then" to instead read "if (curBuddy as string is buddySN as string) then"