Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

While using the Automagica package to automate processes using Python, I have run into an unexpected issue.

I cannot type unicode characters using this tool.

from automagica import *

PressHotkey('win','r')

Wait(seconds=1)

Type(text='notepad', interval_seconds=0)

PressKey('enter')

Wait(seconds=2)

Type(text='Hello æ ø å ', interval_seconds=0)

The æøå characters are not typed, the spaces are though.

Could it be a keyboard layout issue? The function description states that only character keys can be used, but here in Denmark the stated characters are such keys

1 Answer

0 votes
by (29.5k points)

The issue is in pyautogui that does not support special characters

here is my solution

 

from automagica import *

def type_unicode(text):
    import pyautogui
    import pyperclip
    pyperclip.copy(text)
    pyautogui.hotkey("ctrl", "v")

PressHotkey('win','r')
Wait(seconds=1)
Type(text='notepad', interval_seconds=0)
PressKey('enter')
Wait(seconds=2)
type_unicode('Hello æ ø å')

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...