View Full Version : Script to Auto Record incoming Skype calls with Piezo
Jul 6, 2013, 01:23 PM
Could one of you talented coders out there create me a script or something that could run in the background which tells Piezo to auto-record incoming skype calls?
Aug 13, 2013, 05:05 PM
Skype is ending support for their API in September 2013. My first thought on how to accomplish this without the API is to detect when network ports are opened. Skype seems to have 3 ports open all of the time. Mine goes to 6 when a call is active and makes a stop at 5 and 4 after a call before settling back in at 3.
The code below gives you a start on this. Insert the appropriate code to start/stop Piezo where noted. If you get stuck post what you have back here.
repeat -- main event loop
repeat -- loop when no call is present or Skype is not running
if (callInProgress()) then
delay 15 -- sleep for 15 seconds before checking again
-- initiate recording here between repeat loops
-- you are on your own for this one
-- I don't have the Piezo application
if (not callInProgress()) then
delay 15 -- Skype keeps ports open for about 60 seconds after a call ends. Recording will end somewhere between 60 and 75 seconds after talking stops.
-- The only way you get to this line is if there was a recording initiated that has now ended.
-- Tell Piezo to turn the recording off.
set pid to do shell script "ps -Af | grep Skype | grep -v grep | cut -d ' ' -f 4"
if ((pid as text) is "") then
set skypeOpenFilesCount to do shell script "lsof -p " & pid & " | grep ESTAB | wc -l"
ignoring white space
set openNumber to skypeOpenFilesCount as number
if (openNumber > 5) then
log ("not talking")