Anyone got any ideas to run an shell script and while that script is running to pass a keystroke?
This is a sample of my script:
do shell script “/sbin/mount_smbfs -o nobrowse -W TEST.WIN -U test //SERVER.TEST.WIN/folder /tmp/folder”
Once this is run mount_smbfs promts for a password. There is no password on this account and all I need to do is hit enter.
So I need a kestroke command with the do shell script command to pass ‘enter’
The other option for me is to try and find the correct mount_smbfs command.
Thanks for the tip but it didnt work! For some reason I need a password in the " " for it to work with my main script. I have tried N in the mount_smbfs to no prompt for password but it returns an error and still a password prompt.
More detail i think is required. When this is shell script is run:
do shell script “/sbin/mount_smbfs -o nobrowse -W TEST.WIN -U test //SERVER.TEST.WIN/folder /tmp/folder”
I get a GUI SMB Authentication window pop up. I then want to pass an return keystroke to the window.
I have successfully achieved this with another completely different applescript below:
activate application "Finder"
tell application "System Events"
tell process "UserNotificationCenter" to tell window 1
perform action "AXRaise"
click button "OK"
end tell
end tell
I need to be able to run the mount_smbfs script and then this new script straight after, but the first script has to finish first before the second will run.
The other option which I will try now is to do a cron job to run this new script and look for the service “UserNotificationCener” and if found run the new script and then exit.
Anyway any other ideas would be greatly appreciated.