Hey Guys,
Am puzzled with this one.
I have searched google, and tried finding information around the area, but have come up short.
tell application "Safari"
open location "192.168.0.1"
tell application "System Events"
---tell application "Safari"
keystroke tab
keystroke "jay"
keystroke tab
keystroke "password"
end tell
end tell
I get Safari cannot get keystroke
if i comment out safari tell and put in system events tell, apple script returns jay password in the script
- i have tried putting in window1 / in document1 - fails aswell
any help is greatly appreciated
Inside a tell application “System Events” block, you don’t tell an application, you tell a process.
tell application "System Events" to tell process "Safari"
-- do stuff
end tell
Hi,
keystrokes in System Events are always sent to the frontmost application, so you must activate Safari before sending keystrokes.
Anyway setting the values of the text fields directly is more reliable
tell application "Safari"
activate
open location "192.168.0.1"
end tell
tell application "System Events"
tell process "Safari"
repeat until exists sheet 1 of window 1
delay 0.2
end repeat
tell sheet 1 of window 1
set value of text field 1 to "jay"
set value of text field 2 to "password"
end tell
end tell
end tell
Hi Stefan,
is there a way to get this to work with a time capsule?
cheers
a TimeCapsule doesn’t have a web interface
Hey Stefan - With something like this:
mount volume "afp://192.168.0.1/Time capsule" as user name "Abe Lincoln" with password "4score"
i’ve tried a few senarios , however, it freezes my applescript and i have to force quit
Found My Error - Was calling on the wrong IP. However, it still does not set the password:
mount volume "afp://192.168.0.2/Time capsule" with password "4score"
- It fills ther username box correctly, however, does not place the password in the password box
What are you going to accomplish?
mount volume is supposed to mount the hard drive
The AFP
“The Apple Filing Protocol (AFP) is a network protocol that offers file services for Mac OS X and original Mac OS. In Mac OS X, AFP is one of several file services supported including Server Message Block (SMB), Network File System (NFS), File Transfer Protocol (FTP), and WebDAV. AFP currently supports Unicode file names, POSIX and access control list permissions, UNIX quotas[citation needed], resource forks, named extended attributes, and advanced file locking. In Mac OS 9 and earlier, AFP was the primary protocol for file services.”
I was playing around and thought there must be a way to mount a network drive. The above lead me to use it in the call to connect to.
mount volume "afp://TimeCapsule.local/Capsule"
TimeCapsule is the name specified in Airport > Time Capsule in Airport Utility
Capsule is the Time Capsule Disk name specified in Disks > Disks in Airport Utility
Cheers Stefan,
Any ideas on the password issues?
i’ve tried the value 2 field,
I’ve tried with password “”
no luck 
I never use a password, it’s stored in the keychain.
Otherwise have you tried the with password parameter?