Return to Snippet

Revision: 47384
at June 7, 2011 07:55 by Macgeeky


Initial Code
tell application "Keychain Scripting"
	set myKeyChain to current keychain
	set theKeyList to every generic key of myKeyChain whose description is "iTunes innlogging"
end tell

set theKeyNamesList to {}
repeat with x in theKeyList
	copy name of x to the end of theKeyNamesList
end repeat

set selectedKey to text of button returned of (display dialog "Velg hvilken konto du vil logge inn med:" buttons theKeyNamesList)

tell application "Keychain Scripting"
	repeat with x from 1 to (length of theKeyList)
		set theKey to item x of theKeyList
		if the name of theKey is selectedKey then
			set thePassword to password of theKey
			set theUserID to the account of theKey
		end if
	end repeat
end tell

tell application "System Events"
	tell process "iTunes"
		set frontmost to true
		try
			click menu item "Logg av" of menu "Butikk" of menu bar item "Butikk" of menu bar 1
		end try
		click menu item "Logg p�¥â�¦" of menu "Butikk" of menu bar item "Butikk" of menu bar 1
		keystroke theUserID
		keystroke tab
		keystroke thePassword
		keystroke return
		delay 3
		keystroke return
	end tell
end tell

Initial URL


Initial Description


Initial Title
Applescript for multiple accounts login in iTunes

Initial Tags
login

Initial Language
AppleScript