AutoHotkey Community

It is currently May 26th, 2012, 10:59 pm

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 237 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 16  Next
Author Message
 Post subject: Re: Petru
PostPosted: October 31st, 2009, 1:55 pm 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
HotKeyIt wrote:
Code:
#Include c:\Temp\Script.ahk ;works
#Include Script.ahk ;does not work
#Include .\Script.ahk ;does not work

I'm sorry, but I still can not reproduce these problem here. Were the scripts placed in "working directory" ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 2:22 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Host script saved in c:\Temp, as well as Script.ahk.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 2:39 pm 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
HotKeyIt wrote:
Host script saved in c:\Temp, as well as Script.ahk.

So how did you launch the autohotkey.exe, by double click the script file? from command line?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 2:49 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
My fault, I was dropping the file onto AutoHotkey.exe, so working directory was wrong.

I thought working directory for #include is always scripts directory :oops:
Code:
#Include %A_ScriptDir%\Script.ahk ;works fine :)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 3:13 pm 
Added your Unicode version to the Wikipedia page on AutoHotkey.

:)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 5:37 pm 
jackieku wrote:
Anonymous wrote:
The sendinput function doesn't support Unicode characters, such as Chinese characters.

Because SendInput was intent to send a series of key events (not characters). When we type Chinese characters we need a software called input method engine (IME), but the keyboard is the same with the ones in U.S. (same keymap).

However, I'll try to work on it since the SendInput() Windows API seems to support this case.


ok, thank you for your quick reply! I'll keep tring to have more fun. :D


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 7:42 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
:shock:

Just awesome. The power of open source code!

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 7:52 pm 
Offline

Joined: December 17th, 2007, 6:39 pm
Posts: 235
Location: Galati, Romania
HotKeyIt wrote:
My fault, I was dropping the file onto AutoHotkey.exe, so working directory was wrong.

I thought working directory for #include is always scripts directory :oops:
Code:
#Include %A_ScriptDir%\Script.ahk ;works fine :)


That was my mistake too. My bad. But I guess that compiled scripts' applications won't be using Unicode. Someone should also make a AutohotkeySC.bin to support Unicode.

Hope I'm not demanding too much. And yes, that's why I love open source coding!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 8:47 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Ok, here's my first AutoHotkeyU script. It calls a Unicode-only API directly without any kind of conversions.

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; THIS SCRIPT REQUIRES AutoHotkeyU ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#NoEnv

; Sample text here
text =
(
This is just a demo that shows off AutoHotkeyU and the Vista/7 TaskDialogs.

There's not much at the moment but this will support more controls!

Hello World in Japanese: こんにちは、世界!
Hello World in Chinese: 你好,世界!
Hello World in Greek: Γεια σου, κόσμος!
Hello World in Russian: Здравствуй, Мир!
Hello World in Arabic: مرحبا ، العالم!
)

Loop{
   var := TaskDialog("AutoHotkeyU TaskDialog demo", "Hello World", text, "ok|cancel|yes|no|retry|close")
   MsgBox You clicked on %var%
   if(var = "Cancel" or var = "Close")
      ExitApp
}

; TaskDialog function
TaskDialog(title, instruction, text, buttons=0x01, icon=0){
   /* http://msdn.microsoft.com/en-us/library/bb760540(VS.85).aspx
   HRESULT TaskDialog(     
      HWND hWndParent,
      HINSTANCE hInstance,
      PCWSTR pszWindowTitle,
      PCWSTR pszMainInstruction,
      PCWSTR pszContent,
      TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
      PCWSTR pszIcon,
      int *pnButton
   );
   */

   if A_OSVersion not in WIN_VISTA,WIN_7 ; WIN_7 put in for possible future implementation in AutoHotkey
   {
      MsgBox, 16, %A_ScriptName%, This script requires Windows Vista or later.
      OnExit
      ExitApp
   }

   If buttons is not integer
      buttons := TaskDialog_ParseButtons(buttons)
   If icon is not integer
      icon := TaskDialog_ParseIcon(icon)
   ErrorLevel := DllCall("comctl32\TaskDialog", "uint", 0, "uint", 0, "str", title, "str", instruction, "str", text, "uint", buttons, "uint", icon, "int*", ret)
   Return TaskDialog_GetReturnString(ret)
}

; Internal TaskDialog function
TaskDialog_ParseButtons(but){
   var := 0
   StringLower, but, but
   Loop, Parse, but, |, %A_Space%
   {
      if A_LoopField = ok
         var |= 0x01
      else if A_LoopField = yes
         var |= 0x02
      else if A_LoopField = no
         var |= 0x04
      else if A_LoopField = cancel
         var |= 0x08
      else if A_LoopField = retry
         var |= 0x10
      else if A_LoopField = close
         var |= 0x20
   }
   return var
}

; Internal TaskDialog function
TaskDialog_ParseIcon(ico){
   StringLower, ico, ico
   ico = %ico%
   if ico =
      return 0
   else if(ico = "info" or ico = "information")
      return 0xFFFF - 2
   else if ico = warning
      return 0xFFFF
   else if(ico = "stop" or ico = "error")
      return 0xFFFF - 1
   else if ico = sec_warning
      return 0xFFFF - 5
   else if ico = sec_error
      return 0xFFFF - 6
   else if ico = sec_success
      return 0xFFFF - 7
   else if ico = sec_shield
      return 0xFFFF - 3
   else if ico = sec_shield_blue
      return 0xFFFF - 4
   else if(ico = "sec_shield_gray" or ico = "sec_shield_grey")
      return 0xFFFF - 8
   else
      return 0
}

; Internal TaskDialog function
TaskDialog_GetReturnString(but){
   static IDOK = 1
   static IDYES = 6
   static IDNO = 7
   static IDCANCEL = 2
   static IDRETRY = 4
   static IDCLOSE = 8
   
   if(but = IDOK)
      return "OK"
   else if(but = IDYES)
      return "Yes"
   else if(but = IDNO)
      return "No"
   else if(but = IDCANCEL)
      return "Cancel"
   else if(but = IDRETRY)
      return "Retry"
   else if(but = IDCLOSE)
      return "Close"
   else
      return ""
}


EDIT: Small bugfix.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 7:22 am 
Offline

Joined: April 22nd, 2009, 6:04 am
Posts: 29
fincs wrote:
:shock:

Just awesome. The power of open source code!
Yes I totally agree :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 3:35 pm 
Offline

Joined: November 30th, 2008, 1:51 pm
Posts: 73
A new version is uploaded. See the changelog and some outlines at the first post.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 5:23 pm 
Offline
User avatar

Joined: May 5th, 2007, 7:24 pm
Posts: 1240
Location: Seville, Spain
Yesterday I ended up forking your version :P

I'm currently trying to get RegExes working with non-ASCII characters.
Currently this is what I have:
  • Fixed IniWrite, it wasn't outputting Unicode files.
  • Asc(), Chr() and Windows 7 fixes (although you fixed them in the latest release).
  • Added A_IsUnicode which returns 1 if the script is running under AutoHotkeyU.
  • UTF-8 was enabled in PCRE although it still doesn't work right.
  • get_compiled_regex() now uses native Unicode strings and converts to UTF-8 when calling PCRE.
  • Disabled function_order_for_linker_optimization.txt because it was issuing warnings.
  • Added a ReleaseANSI target in the project files although the ANSI versions fails at startup.

PD: I have VC++ 2008 Express.

_________________
fincs
Highly recommended: AutoHotkey_L (see why) (all my code snippets require it)
Formal request to polyethene - I support the unity of the AutoHotkey community
Get SciTE4AutoHotkey v3.0.00 (Release Candidate)
[My project list]


Last edited by fincs on November 2nd, 2009, 2:01 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Wicked good font found.
PostPosted: November 1st, 2009, 8:37 pm 
Offline

Joined: December 29th, 2007, 9:40 pm
Posts: 142
I have been struggling with finding a free mono-spaced unicode compliant font that provided complete coverage for all of the character sets that one might have to code for - either in a multi-lingual script, or in a web-app, without having to resort to the use of multiple fonts.

While coding for western, asian, eastern-block character sets in applications is not insurmountable, having all characters represented accurately in an editor such as Notepad++, in a mono-spaced font (vs. arial unicode ms), proved to be a bit of a challenge.

I present a font set that I just stumbled upon, Unifont, a gnu unicode implementation with a plethora of (dare I say adequate - it is acknowledged that the arabic rendering is not as some might desire/expect.?.) character/glyph coverage.

This font allowed me to have all of the characters in the following code, be rendered as expected in my editor (as depicted here) in an easily readable, mono-spaced font.

Code:
Hello World in Japanese: こんにちは、世界!
Hello World in Chinese: 你好,世界!
Hello World in Greek: Γεια σου, κόσμος!
Hello World in Russian: Здравствуй, Мир!
Hello World in Arabic: مرحبا ، العالم!


Enjoy!

-t

_________________
When replying, please feel free to address me as Tod. My AHK.net site...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 1:36 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
I'm feeling rather unfortunate to have to test separately two new big features, Object and Unicode. Anyway, may I ask why you chose the function name StringGet, instead of e.g., StrGet etc? StringGet appears to me rather out of tune with current naming scheme of AHK, either NumGet/NumPut or InStr/SubStr. I'm just becoming concerned/curious about the opinions of Chris and/or Lexikos and/or other developers, under the assumption that someday these big features are incorporated into the official build.

And, personally, I hope characters like ? [ ] disabled in variable names as in AutoHotkey_L.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 1:43 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
Sean wrote:
And, personally, I hope characters like ? [ ] disabled in variable names as in AutoHotkey_L.
Me too

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 237 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 16  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group