Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dwright1974

macrumors 6502
Original poster
Hello All

This is my first attempt at AppleScript to mount a network share from a Windows 2003 server on a Mac. When I mount the share manually, (Go > Connect to Server) it works perfectly.

When I try and do it through AppleScript it fails every time and I was wondering if someone could help me please?

Here is the script:

============
Code:
tell application "Finder"
	activate
	
	try
		display dialog "Making CC4 Drives available - Press OK to continue or Cancel to stop"
		mount volume "smb://cc4stdfs/rmshared%20documents"
		display dialog "RM Learning Resources are available in Finder"
	on error
		display dialog "This Mac is unable to access RM Learning Resources"
		
	end try
end tell
============

And here is the Event Log:

============
Code:
tell application "Finder"
	activate
	display dialog "Making CC4 Drives available - Press OK to continue or Cancel to stop"
		--> {button returned:"OK"}
	mount volume "smb://cc4stdfs/rmshared%20documents"
		--> error number -10004
end tell
tell application "AppleScript Editor"
	mount volume "smb://cc4stdfs/rmshared%20documents"
		--> error number -36
end tell
tell application "Finder"
	display dialog "This Mac is unable to access RM Learning Resources"
		--> {button returned:"OK"}
end tell
Result:
{button returned:"OK"}
============
I've Googled it but can't find anything to suggest what isn't working?

Any help anyone could be would be great!

Thanks in advance

- D
 
Last edited by a moderator:
You can use a shellscript to make it easier:


mount -t smbfs //user@server/sharename share


this wil require you the make a folder named "share" in the user folder

This wil also work, put it in login items if you want to log into it when you log on

Code:
tell application "Finder"
open location "smb://user:password@computername/sharename"
end tell
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.