Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

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.