I m using adium. Adium can alert me whenever i got email from yahoomail. But i need to do is getting in yahoo mail account without writing username and password. I have some code what i need to do. But the problem starting right this time, ( i m also using Turkish QWERTY PC keyboard layout ) when i make the code work with this layout, it giving error.
I dont now how i make two code set put togetger and work for me. My system 10.5.5
tell application “System Events”
tell process “Safari”
keystroke “Your_email@yahoo.com”
keystroke tab
delay 0.5
keystroke “Your_Password”
delay 1
keystroke return
end tell
end tell
return input
end run
return input
end run
CODE 2
to |toggle input menu| between l
tell application “System Events” to tell menu bar 1 of process “SystemUIServer” to repeat with i in l
tell (first menu bar item whose value is i) to if exists then return {click, click (menu 1’s first menu item whose name is not i)}
end repeat
end |toggle input menu|
|toggle input menu| between {“U.S.”, “Turkish - QWERTY PC”} (* specify the input menu pair required *)
|toggle input menu| between {"U.S.", "Turkish - QWERTY PC"}
tell application "Safari"
activate
make new document
set URL of document 1 to "https://login.yahoo.com/config/login_verify2?&.src=ym"
end tell
delay 3
tell application "System Events"
tell process "Safari"
keystroke "Your_email@yahoo.com"
keystroke tab
delay 0.5
keystroke "Your_Password"
delay 1
keystroke return
end tell
end tell
|toggle input menu| between {"U.S.", "Turkish - QWERTY PC"}
to |toggle input menu| between l
tell application "System Events" to tell menu bar 1 of process "SystemUIServer" to repeat with i in l
tell (first menu bar item whose value is i) to if exists then return {click, click (menu 1's first menu item whose name is not i)}
end repeat
end |toggle input menu|
Summary is : It can get in to the mail account smoothly. Only if my keyboard layout is U.S. But it is not. My keyboard layout standing (Turkish QWERTY PC) mode regularly.
I understand the problem completely. We need make it change the layout from Turkish QWERTY PC in to U.S. then getting into mail then changing layout in to Turkish QWERTY PC mode again.
Here a more sophisticated version, which doesn’t just toggle between two languages,
but memorizes the current language, switches to “U.S.” and than switches back to the former one
set oldLanguage to item 1 of changeInputLanguage("U.S.")
.
.
changeInputLanguage(oldLanguage)
on changeInputLanguage(L)
tell application "System Events" to tell process "SystemUIServer"
tell (1st menu bar item of menu bar 1 whose value of attribute "AXDescription" is "text input")
return {its value, click, click menu 1's menu item L}
end tell
end tell
end changeInputLanguage
tell application “System Events”
tell process “Safari”
keystroke “My_email@yahoo.com”
keystroke tab
delay 0.5
keystroke “My_Password”
delay 1
keystroke return
end tell
end tell
changeInputLanguage(oldLanguage)
on changeInputLanguage(l)
tell application “System Events” to tell process “SystemUIServer”
tell (1st menu bar item of menu bar 1 whose value of attribute “AXDescription” is “text input”)
return {its value, click, click menu 1’s menu item l}
end tell
end tell
end changeInputLanguage
REPORT:
Only if the safari totally closed. Only if script open safari it selfs then it could change keyboard layout. Everything goes well.
Otherwise = If Safari started before script anyhow.
Script try to change, ( you can see visually ) keyboard layout has been trying to change, but could not. Turkish QWERTY PC still there. At that situation problem same.
set oldLanguage to changeInputLanguage("U.S.")
tell application "Safari"
activate
make new document
set URL of document 1 to "https://login.yahoo.com/config/login_verify2?&.src=ym"
end tell
delay 3
tell application "System Events"
tell process "Safari"
keystroke "My_email@yahoo.com"
keystroke tab
delay 0.5
keystroke "My_Password"
delay 1
keystroke return
end tell
end tell
changeInputLanguage(oldLanguage)
on changeInputLanguage(l)
tell application "System Events" to tell process "SystemUIServer"
tell (1st menu bar item of menu bar 1 whose value of attribute "AXDescription" is "text input")
set v to its value
click
delay 0.2
click menu 1's menu item l
delay 1.0
return v
end tell
end tell
end changeInputLanguage
tell application “System Events”
tell process “Safari”
keystroke “your_email@yahoo.com”
keystroke tab
delay 0.5
keystroke “your_password”
delay 1
keystroke return
end tell
end tell
changeInputLanguage(oldLanguage)
on changeInputLanguage(l)
tell application “System Events” to tell process “SystemUIServer”
tell (1st menu bar item of menu bar 1 whose value of attribute “AXDescription” is “text input”)
set v to its value
click
delay 0.2
click menu 1’s menu item l
delay 1.0
return v
end tell
end tell
end changeInputLanguage