Jump to content

Inputting both English and Arabic text problem


Recommended Posts

I have a fairly big database at my company and we are using "Primavera P6" software to input the data however this software doesn't accept large data copy paste method so I created a simple autoit script that would enter the data one by one automatically to the software and it was working well with English only.

Now our company asked us to input the Arabic equivalent of the same cells so I managed to do it (only when inputting arabic). However when I try to input mass cells that contain both languages then I get "??????" when the system is trying to input arabic text!

I have in my code something like this:

Send("G-N2254")
sleep(300)
Send("{ENTER}")
sleep(100)
Send("{ESC}")
sleep(100)
Send("{Right}")
Send("ترانسكو")
Send("{ENTER}")

And depending on the keyboard layout that I have open then it will input the equivalent text, so if I have Arabic keyboard layout then only the arabic text will be input correctly and if I have English keyboard layout then only the English text will be input correctly.

How can I make it that both languages are going to be entered in their correct form?

Link to comment
Share on other sites

That's to be expected: Send() sends simulated keystrokes, so what actually gets sent depends on the currently active keyboard layout.

Use ControlSend or ControlSetText instead. These functions directly send a Unicode string to the target control, independantly of the current keyboard and language settings.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

23 hours ago, jchd said:

That's to be expected: Send() sends simulated keystrokes, so what actually gets sent depends on the currently active keyboard layout.

Use ControlSend or ControlSetText instead. These functions directly send a Unicode string to the target control, independantly of the current keyboard and language settings.

I used

ControlSetText("Primavera P6 Professional R8.3 : (No current project)", "", "TCVirtualQueryGrid2", "شركة")

and

ControlSend("Primavera P6 Professional R8.3 : (No current project)", "", "TCVirtualQueryGrid2", "شركة")

ControlSend worked but it had exactly the same problem as "Send", it only work if keyboard layout is in Arabic, and fail to send English text when layout is in Arabic.

ControlSetText just didn't return anything at all. :(

Link to comment
Share on other sites

17 hours ago, AutoBert said:

Try #RequireAdmin together with ControlSetText.

Ah man... Thanks for the reply, I don't have admin rights at work and I don't think i'll ever get it...

I guess my best bet right now is bit manipulation changing ascii and inputting them letter by letter >.<

I wonder if there is any other solution

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...