tell application "iTunes" set podName to "OhNoes" -- name of ipod set podDelay to 3 -- how often to check ipod status set podcastDelay to 15 -- time to check all podcasts assuming no downloads set podcastName to "Podcasts" -- name of podcasts playlist set initialSize to 1 set currentSize to 0 try updateAllPodcasts repeat until currentSize = initialSize set initialSize to size of playlist named podcastName delay podcastDelay set currentSize to size of playlist named podcastName end repeat on error display dialog "Error updating podcasts" end try set initialSize to 1 set currentSize to 0 try tell source podName update podName repeat until currentSize = initialSize set initialSize to the free space delay podDelay set currentSize to the free space end repeat end tell on error display dialog "Error updating iPod" end try try eject podName on error display dialog "Error ejecting iPod" end try end tell