Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am trying copy a file up to a network drive in AppleScript.

Normally I would do..

do script "mv ~/Desktop/file.txt ~/Folder/file.txt"

What is the correct path to a network drive? I normally connect with finder by doing:

tell application "Finder"
    open location "smb://user:password@netDrive/MyShare"
end tell

How do I do:

do script "mv ~/Desktop/file.txt smb://user:password@netDrive/MyShare/Folder/file.txt"
share|improve this question
add comment

2 Answers 2

The command

do shell script "mv ~/Desktop/file.txt smb://user:password@netDrive/MyShare/Folder/file.txt"

return 'No such file or directory' Finder mounts network drives under the /Volumes/

do shell script "mv ~/Desktop/file.txt /Volumes/netDrive/MyShare/Folder/file.txt"
share|improve this answer
add comment

The correct syntax would be smb://[<user>@]<workgroup>[:<port>][/]

To answer your second question:

do shell script "mv ~/Desktop/file.txt smb://user:password@netDrive/MyShare/Folder/file.txt"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.