Two related questions:
Two related questions:
- Subject: Two related questions:
- From: "John C. Welch" <email@hidden>
- Date: Wed, 18 Sep 2002 16:46:57 -0400
1) (I know this has come up , but I can't remember my userid/passsword for
the archives, so forgive me) How does one go about getting the current
logged in user short name, aka userid
2) The reason I need this is I am trying to set up some automounts built
from Keychain info, so I need the userid for this...but I'm also having a
problem with my handler in the script...I *think* it's right...but I'm
getting data errors:
Keychain Scripting got an error: Some data was the wrong type.
Code follows:
Thanks,
John
tell application "Keychain Scripting"
set theKeychain to keychain "jwelch"
set theKeys to every Internet key in theKeychain
repeat with theKey in theKeys
set theKeyName to the name of theKey
if theKeyName = "Software" then
set theResult to mountOps(theKey, theKeychain) of me
else if theKeyName = "Shared-Files" then
set theResult to mountOps(theKey, theKeychain) of me
else if theKeyName = "My Server Home" then
set theResult to mountOps(theKey, theKeychain) of me
end if
end repeat
end tell
on mountOps(theKey, theKeychain)
--set theTest to theKey as string
--display dialog theTest
set theUser to the account of theKey of theKeychain
set thePassword to the password of theKey of theKeychain
set theServer to the server of theKey of theKeychain
set thePath to the path of theKey of theKeychain
set thePort to the port of theKey of theKeychain
set theProtocol to the protocol of theKey of theKeychain as string
if theProtocol contains "smb" then
set theProtocol to "smb"
end if
exit repeat
--set theURL to theProtocol & "://" & theServer & thePath as string
--mount volume theURL as user name theUser with password thePassword
return 0
end mountOps
--
"De oppresso liber"
(To free the oppressed)
US Army Special Forces
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.