Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automate an Internet content filter' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automate an Internet content filter
Authored by: carina_st on May 29, '11 03:52:55PM
An addition to my last post: when I wanted to run my script via the shell it did not work at first. The error message was "Keychain Scripting got an error: Application isnít running. ". The solution for this problem can be found here: http://support.apple.com/kb/TA23348?viewlocale=en_US So I added the following code before trying to get the password from the keychain and it works now also when being called from the shell.
	-- Quit Keychain Scripting if it's running, since opening this script may have implicitly launched it.	
	try
		tell application "System Events"
			set foundApp to first process whose name is "Keychain Scripting"
			set pid to id of foundApp -- this will exit the try block if the process isn't running
			quit foundApp -- we get here if the process is found
		end tell
	end try
	
	-- get Finder to launch Keychain Scripting
	tell application "Finder"
		open application file ((startup disk as string) & "System:Library:ScriptingAdditions:Keychain Scripting") as alias
	end tell


[ Reply to This | # ]