Hello,
Ive never used applescript nor really programed so forgive the ignorance.
I need to create a droplet that will take a text file with a path to a file on a nfs share in it, mount the share, copy the file to the users desktop and then unmount the ifs share.
For example, the text file may contain “/path/to/nfsshare/object_to_be_downloaded”
Here is the code I have patched together from several sources (this the actual path information anonymized)
on open Path_File
set UserName to system attribute “USER”
set desktopPath to “/Users/” & UserName & “/Desktop/”
tell application “Finder” to mount volume “nfs://nfsshare/path/”
open for access Path_File
set pathVariable to (read Path_File)
close access Path_File
set FileSource to “/Volumes/nfsshare” & pathVariable
do shell script "cp " & FileSource & desktopPath
end open
When I drop the test file into the droplet I get an error about the usage of cp that follows:
sh: line 1: /Users/user/Desktop/: is a directory
Any idea what I am doing wrong?
Model: iMac
AppleScript: 2.4.3
Browser: Safari 537.31
Operating System: Mac OS X (10.7)