image
image

Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #1  
Old October 20th, 2002, 04:38 PM
Gnomo's Avatar
Proud Member
 
Join Date: Oct 2002
Location: Neither Here nor There
Posts: 280
Thanks: 0
Thanked 0 Times in 0 Posts
Gnomo is on a distinguished road
Question AppleScript & SMB

Alright, so here's what's up.
I'm trying to write an AppleScript (since recording in 10.2 still does not work) that will mount a smb drive on a Win 2K Domain.

Normally I can access the drive using the connect to server dialog, but I would like to be able to do this on start up.

Searching macosx.com I found two scripts that looked promising, but they both don't work. The first said:
tell application "Finder"
try
open location "afp://username:password@server ip/share"
end try
end tell

I tried to convert that for smb, by changing the protocol from afp to smb. Script Editor tells me that the syntax is correct, but it doesn't do anything when I click "run". I tried to run it via the terminal, but I guess I'm doing something wrong (tried ./scriptname) because it tells me that it cannot run the binary file.

The second script said:
mount volume "afp://server ip/share" as user name "username" with password "password"

I tried that (also changing it to smb), but because the username is my student ID number, it gives me a syntax error that "a number cannot follow """. "

Any ideas on how to make one of these two work?
__________________
"Your computer has too much computer in it, and not enough typewriter."

GCS/IT$ d- s+: a--? C++ U* !P L++ E---- W+++ !N o? !K-? !w O? M++ V? !PS !PE Y+ PGP t++ !5 X+ R+ tv+ b+ DI+ D- G+ e(++) h* r+++ y?
Reply With Quote
  #2  
Old October 20th, 2002, 05:07 PM
Gnomo's Avatar
Proud Member
 
Join Date: Oct 2002
Location: Neither Here nor There
Posts: 280
Thanks: 0
Thanked 0 Times in 0 Posts
Gnomo is on a distinguished road
I figured it out.

The solution was to combine the two so that the script reads:
mount volume "smb://username:password@server ip/share"
__________________
"Your computer has too much computer in it, and not enough typewriter."

GCS/IT$ d- s+: a--? C++ U* !P L++ E---- W+++ !N o? !K-? !w O? M++ V? !PS !PE Y+ PGP t++ !5 X+ R+ tv+ b+ DI+ D- G+ e(++) h* r+++ y?
Reply With Quote
  #3  
Old October 21st, 2002, 04:12 PM
Registered User
 
Join Date: Jun 2002
Location: nj
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
imbrokn is on a distinguished road
This is the applescript that i use.

mount volume "smb://shareIP/shareName" as user name "yourUserName" with password "yourPassword"

it works like a gem. Make sure that you save it as an application. And also, it doesn't get run in the terminal, once you save it as an application, then you can just double click on it and there you go. Then put it in your LoginItems and it will run automatically.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AppleScript front end to a shell script? meancode Mac OS X System & Mac Software 0 March 17th, 2002 09:25 PM
AppleScript in the Finder in 10.1 (Spring-Loaded Folders???) simX Apple News, Rumors & Discussion 1 October 14th, 2001 10:27 PM
AFP vs. SMB (File name lengths) legacyb4 Apple News, Rumors & Discussion 1 October 7th, 2001 03:05 PM
smb and classic Innerhofer Apple News, Rumors & Discussion 0 October 1st, 2001 07:14 AM
AppleScript Studio? Is this our new HyperCard? rharder Apple News, Rumors & Discussion 5 September 27th, 2001 12:44 PM


All times are GMT -5. The time now is 12:05 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.