Jump to content

Why can't AutoIT do it ?


Yogi Yang
 Share

Recommended Posts

  • Administrators

I just found out that AutoHotKey which is a hybrid of AutoIT can send UNICODE characters to any target application on any 32Bit Windows OS then why can't AutoIt do that?

It can't send unicode, like AutoIt it is a fully ansi program (apart from a couple of clipboard related unicode funcs I think). Please give an example of something that doesn't work and we'll take a look.
Link to comment
Share on other sites

  • Administrators

I've found a slight bug in our extended ANSI sending code. We were doing ALT+nnn instead of ALT+0nnn and according to a page on the net:

It is important that all 4 digits (including the leading 0) be typed; typing a 3-digit code will enter characters from the obsolete code page 437

This probably means we are missing out on being able to send a portion of the extended-ansi characters. I still need to you to give me an example though!

Edit: updating the code with this change now, it'll be in the next beta later today

Edit: Beta uploaded to http://www.autoitscript.com/autoit3/files/beta/autoit/

Edited by Jon
Link to comment
Share on other sites

Yeah, AutoHotKey... how low can such a man go...

This says enough when you look at theirs source code:

Snippets from AutoHotKey's script.cpp:

...

, mIsRestart(false), mIsAutoIt2(false), mErrorStdOut(false)

// Make the mouse fast like AutoIt2, but not quite insta-move. 2 is expected to be more

// reliable than 1 since the AutoIt author said that values less than 2 might cause the

// drag to fail (perhaps just for specific apps, such as games):

...

// Omit AutoHotkey from the window title, like AutoIt3 does for its compiled scripts.

// One reason for this is to reduce backlash if evil-doers create viruses and such

// with the program:

...

// Update: Using V2 gives an compile error so trying V1. Update: Trying sizeof(NOTIFYICONDATA)

// for compatibility with VC++ 6.x. This is also what AutoIt3 uses:

Even their's 'getting started' example contains:

"; QUICK-START TUTORIAL: If you've never used an automation language such\n"

"; as AutoIt, please read the quick-start tutorial in the help file. It\n"

"; will help you begin scripting your own macros and hotkeys right away.\n"

No more comments...

-Sven

Link to comment
Share on other sites

  • 2 weeks later...
  • Administrators

This turned out to be an odd misunderstanding and poor documentation of the {ASC} bit of Send.

For future reference AutoIt is an ANSI application and as such reads in the script files in ANSI mode which allows an extended character set of 255 characters (see the appendix for the full list). AutoIt will happily send all the printable characters in that character set, and for keyboards that support it will also use diadic character input where appropriate (that's when you press a "special" key followed by a normal letter to get accented characters, many European languages with the notable exception of English use this method of input so it's nice to be able to support it).

To send UNICODE characters (i.e have a code of greater than 255) you must use the Send("{ASC nnnn}") command and the character's unicode value. The character that the original poster wanted to send was what looked to be a Chinese symbol with the character code 2709 - this is done with Send("{ASC 2709}").

I've made comments about this in the Send function and Send Key notes in the latest helpfile.

Link to comment
Share on other sites

  • 3 years later...

Unicode Input it's not so easy on Windows. The ASC method does not work in most cases because Windows API does not translate any Unicode string in a key stroke (only the ones that can be introduced using current keyboard layout)

If you want to simulate Unicode input you can use the ALT+0xxx method that does work on any keyboard layout. I've wrote an article about this at http://blog.i18n.ro/automation-and-unicode...-under-windows/

Link to comment
Share on other sites

Nice bump of a 3 year old post. As its your first post it come pretty close to spamming...

Please refrain from bumping topics that have no reason to be resurected. A lot has changed since the last few posts...

Cheers,

Brett

Link to comment
Share on other sites

Would you believe 4 years old? And you're right, a lot has changed in the intervening 4 years. In fact this whole thread no longer applies.

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

He's got a bug open which is partially correct. There was an issue with Autoit sending a leading zero when using the ASC notation and hex numbers. Fixed in next beta.

That would explain it. Thanks Jon. I was going to look up what version we were actually using in Jan 05 but I didn't get that far.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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