PDA

View Full Version : I need help!!!! (this applescript can get to quit after run)




qb-animation
Sep 1, 2009, 06:54 AM
I need help!!!!

with this applescript can get to quit after run and applescript with close on OSX shutdown.

thank you for your help


(*Steve Jørgensen, Copyright ® 2009 qb-animation.org *)

-- Du skal først indtaste brugernavn og adgangskode som står nederst i applescriptet




global UserName
global ServerName
global passwd

on ActivateTerminal()
set ScriptCommand to "ssh -T " & UserName & "@" & ServerName

tell application "Terminal"
do script ScriptCommand
tell application "System Events"
keystroke "m" using {command down, option down}
end tell
delay 2
do script passwd in window 1
end tell

end ActivateTerminal

on ActivateTerminal2()

set ScriptCommand to "ping -i 15 google.com"
display dialog "K-Net Utility" & return & return & ¬
"Du er nu logget på K-Net
Vil du starte keep alive, som hjælper dig med at holde internetsforbindelsen oppe?" buttons {"Cancel", "OK"} default button 1

set hostname to "www.google.com"
do shell script "ping -i 15 " & hostname


end ActivateTerminal2

on ActivateTerminal3()
display dialog "K-Net Utility" & return & return & ¬
"Du er nu logget på K-Net
Vil Lukke af" buttons {"Cancel", "OK"} default button 1

tell application "Terminal"
activate

contents quit


end tell
end ActivateTerminal3


on run
set ServerName to "fw2.k-net.dk"

set UserName to "xxxx" -- Erstat dit brugernan med XXXXX
set passwd to "yyyy" -- Erstat din adgangskode med YYYYY
ActivateTerminal()
ActivateTerminal2()
ActivateTerminal3()
end run



`lowell`
Sep 2, 2009, 06:24 AM
i don't know **** about applescript, but I may be of help just the same.

this page: http://www.bombich.com/mactips/loginhooks.html lists the keys available for com.apple.loginwindow . using NSUserDefaults is probably over kill for setting a quick logout script once, so if applescript supports wrapping terminal commands, do that. like in the link.

google must be broken for some people.

:)

qb-animation
Dec 18, 2009, 04:12 PM
Thanks (Problem solve)