UI Scripting Question

I am trying to create a script that will prompt a user to change their password on a remote AFP server every 30 days. To do this, I use the “mount volume” command and then I plan to use UI scripting to get the user to the change password window.

I can get the user as far as the “Connect to the file server” window, but can’t get any farther because the “Connect to the file server” window is an untitled window, so I can’t reference it in the script. I’ve tried using the UI Inspector to find a window ID I can reference, but there is nothing.

Can anyone give me some guidance on this?

Bob Reed[/b]

I’ve never used the mount volume command, so I don’t know what the window looks like.

But after the window is visible, the normal reference would be: front window or window 1

I am mounting volumes and had that same problem till I found that you can mount volumes prior to that window by adding the user name and password before and then concatinating it with that volume. Try this code out but replace VOLUME with the desired volume or sharepoint. I just cant get the password dialog box to be masked.

set REQ_response to “”
repeat while REQ_response = “”
set REQ_response to display dialog “Please enter your Domain Name (#####)” default answer “” buttons {“Quit”, “Submit”} default button “Quit” with icon note
if button returned of REQ_response is “Quit” then
set REQ_CANCEL_RESPONSE to display dialog “Are you sure you want to quit execution?” buttons {“YES”, “NO”} default button “YES” with icon stop
if button returned of REQ_CANCEL_RESPONSE is “NO” then
set REQ_response to “”
else
if button returned of REQ_CANCEL_RESPONSE is “YES” then
–quit
exit repeat
end if
end if
else
if button returned of REQ_response is “Submit” then
if the text returned of REQ_response is not “” then
set PW_response to “”
repeat while PW_response = “”
set PW_response to display dialog “Please enter your Domain Password” default answer “” buttons {“Quit”, “Submit”} default button “Quit” with icon note
if button returned of PW_response is “Quit” then
set PW_CANCEL_RESPONSE to display dialog “Are you sure you want to quit execution?” buttons {“YES”, “NO”} default button “YES” with icon stop
if button returned of PW_CANCEL_RESPONSE is “NO” then
set PW_response to “”
else
if button returned of PW_CANCEL_RESPONSE is “YES” then
–quit
exit repeat
end if
end if
else
if button returned of PW_response is “Submit” then
if the text returned of PW_response is not “” then
set pw to the text returned of PW_response
set REQ to the text returned of REQ_response
activate application “Finder”
tell application “System Events”
tell process “Finder”
click menu item “Connect to Server…” of menu “Go” of menu bar item “Go” of menu bar 1
delay 1
–This set the connection string
keystroke “afp://” & REQ & “:” & pw & “@” & “YOUR VOLUME HERE
delay 1
click button “Connect” of window “Connect To Server”
end tell
end tell

							--EXECUTE SYSTEM PROFILER HERE
							
							--COPY SYSTEM PROFILE TO SHAREPOINT
							
							--CLEAN UP
							
						else
							set PW_response to ""
						end if
					end if
				end if
			end repeat
		else
			set REQ_response to ""
		end if
	end if
end if

end repeat