Simple apple script - Beginner Problem
Simple apple script - Beginner Problem
- Subject: Simple apple script - Beginner Problem
- From: James Bensley <email@hidden>
- Date: Tue, 14 Jul 2009 11:15:37 +0100
Hey Guys,
I'm an apple script beginner and I can't work out my script isn't
working; I have written a wee line of shell script which I want to run
from an apple script, this snippet is broken. It displays the UNC path
of a users home folder stored in Active Directory, it just prompts the
user for their username then it looks up their unc location:
property user_name : ""
if user_name is "" then
set dialog_1 to display dialog "Please enter your username" default answer ""
set the user_name to the text returned of dialog_1
end if
set UNC to (do shell script "dscl localhost read /Active Directory/All
Domains/Users/" & user_name & " homeDirectory | awk
'BEGIN{FS=\":\"};{print $3}'")
display dialog UNC
Pretty simple really. There are two things to note here; The spaces in
"Active Directory/All Domains" did have an escaping \ in them when I
wrote the line in a shell script but the apple script editor doesn't
like them? Also the awk bit didn't have the escaping \'s on the
command line button apple script editor wants them added it?
If anyone knows why my dialog box is blank I would be very grateful;
ultimately I want to prompt the user for their username and password
then mount their smb home directory listed in Active Directory if
anyone already has a script for this?
James ;)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GIT/MU/U dpu s: a--> C++>$ U+> L++> B-> P+> E?> W+++>$ N K W++ O M++>$ V-
PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+> DI D+++ G+ e(+++++) h--(++) r++ z++
------END GEEK CODE BLOCK------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden