tell application "Skype"
set volume 0
set Dumb to "Just do something.."
end tell
tell application "System Events"
set visible of process "Skype" to false
delay 2
end tell
tell application "Skype"
set AppleScript's text item delimiters to " "
set Res to send command "CALL fam.munafo" script name "MyScript"
if the (count of windows) is not 0 then
set visible of every window to false
end if
if (item 1 of (every text item of Res) is "CALL") then
set CallId to my GetPart(Res, 2, " ")
set CallStatus to "unknown"
set MaxTries to 60
repeat while (CallStatus is not "INPROGRESS" and CallStatus is not "REFUSED" and CallStatus is not "FAILED" and MaxTries > 0)
if the (count of windows) is not 0 then
set visible of every window to false
end if
delay 1
set MaxTries to MaxTries - 1
set Res to send command "GET CALL " & CallId & " STATUS" script name "MyScript"
set CallStatus to my GetPart(Res, 4, " ")
end repeat
if CallStatus is not "INPROGRESS" then
"FAILED! " & CallStatus & " After " & MaxTries
else
send command "ALTER CALL " & CallId & " START_VIDEO_SEND" script name "MyScript"
end if
else
Res
end if
--display dialog "ALTER CALL " & CallId & " START_VIDEO_SEND"
end tell
on GetPart(s, p, d)
set theList to every text item of s
return (item p of theList)
end GetPart