Re: Capturing username for script that mounts server
Re: Capturing username for script that mounts server
- Subject: Re: Capturing username for script that mounts server
- From: kai <email@hidden>
- Date: Wed, 30 Mar 2005 23:33:29 +0100
On Wed, 30 Mar 2005 17:10:33 -0500, Ed Wiederer wrote:
Thanks. Unfortunately, I won't be able to test it out until next week,
but one follow-up/clarification:
I assume running the "whoami" script captures the user name associated
with the account (i.e. in the Accounts pane of System Preferences),
but it's possible that some people have a different name for logging
in to these servers than the account name on their Mac (I'm not IT --
I didn't do it!)... If that is the case, can I set myUser to missing
value, as John suggests, but still use my dialog box solution? One
other thing, and forgive my green-ness with all of this, in the
context of the entire script, I assume I put the property myUser :
missing value command above the tell Finder command, but execute the
shell script or dialog box after the tell Finder command(?)
You could try something like this, Ed (watch for line wraps):
---------------
property myUser : missing value
on adding folder items to this_folder after receiving these_items
if myUser is missing value then set myUser to text returned of
(display dialog "Enter your user name" default answer do shell script
"whoami")
tell application "Finder" to try
set thelist to do shell script "ls -a /Volumes/"
if thelist does not contain "Server1" then
mount volume "smb://" & myUser & ":@10.10.10.10/Server1"
end if
if thelist does not contain "Server2" then
mount volume "smb://" & myUser & ":@10.10.10.10/Server2"
end if
duplicate these_items to disk "Server1"
duplicate these_items to disk "Server2"
end try
end adding folder items to
---------------
However, none of this will solve the problem you mentioned earlier -
and, unless that is resolved, you may still be getting a dialog every
time.
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden