Hello;
Stats:
AppleScript
OSX (Tiger), MAC Pro
relatively new to then Mac , absolutely new to scripting.
I’m posting this from a PC! I know, I know, the mac is my friends and he doesn’t know anything about computers
I searched the forums for some stuff.
in a script I need to :
- change to HOME Directory ( the current code was generated by the 'record" button )
- launch terminal
- fire an external shell (this works)
- enter in the administrator password
- enter in a password for the external shell in step 3
- launch safari or Firefox to localhost
7 wait till all is entered then close all applications
any help would be greatly.
Thanks in Advance
Allan
– set up termina; and launch safari to a specific site
– DEC 4,2010
– ========================================
– change to home directory
– note : this does not fire up outside the script editor ( run as a stand alone application)
– ========================================
tell application “Finder”
activate
select Finder window 1
set target of Finder window 1 to folder “X_User_X” of folder “Users” of startup disk
end tell
tell application “Finder”
activate
select window of desktop
select Finder window 1
set target of Finder window 1 to startup disk
select Finder window 1
select Finder window 1
end tell
– ========================================
– fire an external shell, enter in 2 passwords
– ========================================
set shell_cmd_1 to “sh targetdb.sh”
set shell_cmd_2 to “password” – super user password I would li
set shell_cmd_3 to “DB9999999?” – password to site specified in 'targetdb.sh"
tell application “Terminal”
activate
end tell
tell application “System Events”
– note : I just added “tell process/end tell” for wach do script. is that Correct?
tell process “Terminal”
do script shell_cmd_1
end tell
delay 1
tell process “Terminal”
do script shell_cmd_2
end tell
delay 1
tell process “Terminal”
do script shell_cmd_3
end tell
delay 1
– ----------------------------
– do i put the safarie stuff here ?
– -----------------------------
– end of terminal
end tell
end tell
– ========================================
– launch safari and got to local host
– ========================================
tell application “Safari”
open location “https://localhost”
end tell
tell application “System Events”
delay 1
tell process “Safari”
– set frontmost to true
– keystroke “username”
– keystroke tab
– keystroke “password”
– keystroke return --(if you uncomment this it will click the sign in button) not getting you anywhere unless you have an account with this username & password though!!
end tell
end tell