Ñ„Ñ„Ñ„:Ñ„Ñ„Ñ„Ñ„Ñ„:Ñ„.Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„:Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„:Ñ„Ñ„Ñ„:Ñ„Ñ„Ñ„Ñ„_Ñ„Ñ„Ñ„Ñ„.Ñ„Ñ„Ñ„
instead of
/Users/a.bcd/Documents/tmp/myfile.txt
into Skype application.
But only when Skype is in Russian keyboard layout.
But if i past clipboard content in Skype manually - all OK (no matter of keyboard layout).
Can i emulate “paste” commmand without “keystroke”?
I have never tried to change the keyboard layout by a script, and I suppose it may be hard to do so.
Have you tried something like this?
set utf8 to the clipboard as «class utf8»
set the clipboard to utf8
tell application "Skype" to activate
tell application "System Events"
tell application process "Skype" -- or whatever
keystroke "v" using command down
--keystroke utf8
-- an alternative
end tell
end tell
I had to add extra line:
keystroke “v” using command down
keystroke “м” using command down --if kyrillic layout (otherwise didn’t passed clipboard content)
‘keystroke’ can only type characters from the currently active keyboard layout. Any characters in the passed text which aren’t in that layout are rendered as whatever the layout produces for key code 0, which appears to be “Ñ„” in the case of Russian.
set theText to "/Users/a.bcd/Documents/tmp/myfile.txt"
set the clipboard to theText as «class utf8»
tell application "TextEdit" to activate
delay 0.2
tell application "System Events" to tell process "TextEdit"
keystroke "м" using {command down}
keystroke theText
end tell
When the layout is set to Russian, keystroke “v” using {command down} does nothing.
Keystroke the string give the “infamous” Ñ„Ñ„Ñ„Ñ„Ñ„/Ñ„.Ñ„Ñ„Ñ„/Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„/Ñ„Ñ„Ñ„/Ñ„Ñ„Ñ„Ñ„Ñ„Ñ„.Ñ„Ñ„Ñ„
even if the string is defined as «class utf8».
Yvan KOENIG (VALLAURIS, France) mercredi 21 janvier 2015 18:47:31
PS :
“м” is on the key labeled “V” on azerty/qwerty keyboards.