set tempFilePath to "/tmp/backupAliasTemp" set tempFile to POSIX file tempFilePath
tell application "System Events" set backupAlias to property list item "BackupAlias" of contents of property list file "/Library/Preferences/com.apple.TimeMachine.plist"
set tempFileHandler to open for access tempFile with write permission try write ((text of backupAlias) as Unicode text) to tempFileHandler end try close access tempFileHandler end tell
set timeMachineVolume to POSIX file (do shell script ("ruby -e \"require 'nkf';puts NKF.nkf('-mB -w', File.read('" & tempFilePath & "'))\" | strings | tail -n 1; rm " & tempFilePath))