Sharing Files on a network drive.... please help!

Please help!!!

I am trying to make an automator workflow application that (1) connects me to a network drive, (2) takes all files on the desktop and puts then into a new folders with todays date, then (3) transfers all of the files in the folder to the shared network drive.

The problem is that the folder gets created with the current date, but then the computer transfers all of the files to the shared drive without putting the files in the new folder.

I have my file located at http://www.paullywog.com/shared_files.zip

Please help, I am soo close to having this work I just want to see it through.

Regards,
pallen

Hi,

this is a pure AppleScript solution
It does

¢ create a folder at desktop with name “Desktop Items-[mm_dd_yy]” (the automator action uses slashes in the date string which is not recommended)
¢ label the folder red
¢ move all files on desktop into this folder
¢ move the folder to the shared volume (the folder on desktop will be deleted)

Please check the path to the shared volume, I’m not sure that I got it right


property theShare : "Computer Lab #1"

if theShare is not in (do shell script "/bin/ls /Volumes") then
	mount volume "afp://10.196.10.68/Student's Public Folder"
end if

set todaysFolderName to "Desktop Items-" & (do shell script "/bin/date +%m_%d_%y")
tell application "Finder"
	set theFiles to items of desktop whose class is not disk
	set todaysFolder to make new folder with properties {name:todaysFolderName}
	set label index of todaysFolder to 2
	move theFiles to todaysFolder
end tell
set todaysSharedFolder to "/Volumes/" & theShare & "/Student's Public Folder/"
do shell script "/bin/mv " & quoted form of POSIX path of (todaysFolder as text) & space & quoted form of todaysSharedFolder

Thanks for your help.

The only problem I have encountered are the lines:

set todaysSharedFolder to “/Volumes/” & theShare & “/Student’s Public Folder/”

do shell script "/bin/mv " & quoted form of POSIX path of (todaysFolder as text) & space & quoted form of todaysSharedFolder

What happens is the folder is created on the desktop, but there is no transfer because the computer says that the files does not exist.

Not really sure what is happening here.

Thanks again for your help,
pallen

That’s why I wrote

mount the volume, look into /Volumes (by typing ⇧⌘G and /Volumes in Finder) and check the path.
It must be like /Volumes/sharedVolume/folder

ok, so I changed the location from:

set todaysSharedFolder to “/Volumes/” & theShare & “/Student’s Public Folder/”

to

set todaysSharedFolder to “/Volumes/Student’s Public Folder/” & theShare

All of the files transfered over but it also created a new folder entitled “Computer Lab #1”. So I think I incorrectly changed the order for the file transfer.

Thanks again,
pallen

according to your Automator workflow I assumed that you have included the name “Computer Lab #1” somewhere.
If you don’t need it, delete the property line and the occurrences of theShare

Thank you soo much. You have made many student’s lives easier. I had one last question for you, I would like to write an applescript that will mount the volume and take the user to the directory. This way a teacher or a student can browse for their previous work file.

I was able to get the computer to connect to the drives with:

set theShare to "Computer Lab #1"
	set mountedVolumes to list disks
	if mountedVolumes does not contain theShare then
		mount volume "afp://10.196.10.68/Student's Public Folder"
	end if

But I cannot figure out how to get make the folder show up on the desktop.

The path I would like to show is /Volumes/Student’s Public Folder/

Thank you soo much,

regards,
pallen

There it is again !!!
Where does that Computer Lab thing come from?

If you have a server 10.196.10.68 and a volume Student’s Public Folder on this server
then this volume appears in the folder /Volumes.

I prefer /bin/ls to list the disks. It’s more reliable than list disks


set theShare to "Student's Public Folder"
if theShare is not in (do shell script "/bin/ls /Volumes") then
	mount volume "afp://110.196.10.68/" & theShare
end if
tell application "Finder"
	repeat until exists disk theShare
		delay 0.5
	end repeat
	reveal disk theShare -- this line opens the folder
end tell

Note: I strongly recommend to avoid any special character like the apostrophe in file or folder names on shared volumes

OK,

I dumped the Computer Lab name (that was the shared computer’s name, thats all it was… sorry for the confusion)

I have only have one more thing that I am trying to do with the files on the shared drive and then I am finished. Instead of labeling all of the folders as red, I was wondering if it was possible to change the folder color based on the day, like monday red, tuesday blue, ect.?

Because as it stands now, it is just a sea of red folders and it is hard to do a visual scan of the folder names.

Thanks again,
paulmattallen

the label color depending on the weekday is no problem


.
set label index of todaysFolder to (weekday of (current date) as integer)
.