Universal path in Terminal I'm writing an AppleScript that will allow me to copy the Time Machine folder from an external drive and paste it onto the user's desktop of their Mac. The reason I'm doing this is because when a time machine backup isn't working as it should, we have to manually move it. Well, I'd like to make this process easier for people and just create a script to do it.

tl;dr problem:
How do I make a variable location?

Ex: /Volumes/Time\ Machine/Backups.backupdb///Users  

The X and Y are going to be different for everyone's Mac. People have different names for their macs and Hard Drives. How could I make a universal location? Thanks!
You can get the machine name with scutil --get ComputerName and the name of the boot volume with 

basename "`find -x /Volumes/ -type l`"


Note that both of these may well return a string containing spaces. So you want to do this

COMPUTER="`scutil --get ComputerName`"
VOLUME="`basename \"\`find -x /Volumes/ -type l\`\""


then

TIMEPATH="/Volumes/Time Machine/Backups.backupdb/$COMPUTER/$VOLUME/Users"