Applescript for multiple accounts login in iTunes


/ Published in: AppleScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. tell application "Keychain Scripting"
  2. set myKeyChain to current keychain
  3. set theKeyList to every generic key of myKeyChain whose description is "iTunes innlogging"
  4. end tell
  5.  
  6. set theKeyNamesList to {}
  7. repeat with x in theKeyList
  8. copy name of x to the end of theKeyNamesList
  9. end repeat
  10.  
  11. set selectedKey to text of button returned of (display dialog "Velg hvilken konto du vil logge inn med:" buttons theKeyNamesList)
  12.  
  13. tell application "Keychain Scripting"
  14. repeat with x from 1 to (length of theKeyList)
  15. set theKey to item x of theKeyList
  16. if the name of theKey is selectedKey then
  17. set thePassword to password of theKey
  18. set theUserID to the account of theKey
  19. end if
  20. end repeat
  21. end tell
  22.  
  23. tell application "System Events"
  24. tell process "iTunes"
  25. set frontmost to true
  26. try
  27. click menu item "Logg av" of menu "Butikk" of menu bar item "Butikk" of menu bar 1
  28. end try
  29. click menu item "Logg p�¥â�¦" of menu "Butikk" of menu bar item "Butikk" of menu bar 1
  30. keystroke theUserID
  31. keystroke tab
  32. keystroke thePassword
  33. keystroke return
  34. delay 3
  35. keystroke return
  36. end tell
  37. end tell

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.