Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

qb-animation

macrumors newbie
Original poster
Sep 1, 2009
2
0
I need help!!!!

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

thank you for your help


Code:
(*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
 

Attachments

  • K-net+test-kopi.scpt.zip
    4.7 KB · Views: 47

`lowell`

macrumors newbie
Aug 20, 2009
29
0
San Diego
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.

:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.