Mount / Copy ALL files / Unmount SMB Volume to Mac Folder

I have a folder of Quickbooks data on my PC - I’m trying to copy all that data to a Leopard Backup folder on my desktop.


tell application "Finder"
	set PCData to mount volume "smb://user:pass@pc.local/Intuit"
--	set MacBackUp to ((path to desktop) & "QBackup" & ":") -- <-- syntax is out of whack

 	set MacBackUp to (choose folder) -- <-- returns "Finder got an error: The operation could not be completed because you do not have enough access privileges." However, I can manually perform this operation. 
	
	duplicate PCData to MacBackUp replacing yes
	eject disk "Intuit"
end tell

I’ve tried this oodles of different ways:

  • duplicate PCData to MacBackUp replacing yes
  • duplicate every item of PCData to MacBackUp replacing yes
  • duplicate every item of folder PCData to folder MacBackUp replacing yes
  • “as string” at the end of lines

I’m starting to go crosseyed. Any assistance is appreciated.

– rg

Model: MacBook Pro
AppleScript: 2.0.1
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)

You have to change ‘path to desktop’ to a string before you can add another string to it. By itself it’s in mac path format. Also, now that the path is in string format you have to change it back to a mac format before you can use it in a command. Note I placed the word “folder” before the path to change it back. Here’s what your script should look like…

mount volume "smb://user:pass@pc.local/Intuit"
set MacBackUp to (path to desktop folder as text) & "QBackup:"

tell application "Finder"
	set remoteDisk to disk "Intuit"
	duplicate remoteDisk to folder MacBackUp replacing yes
	eject remoteDisk
end tell

reg, you’re a lifesaver. Just the fix I needed. Thanx. :slight_smile: