AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

-: Seek :- Launch program quickly & easily
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  

If you've tried Seek, do you:
like it?
77%
 77%  [ 21 ]
neutral...
18%
 18%  [ 5 ]
hate it?
3%
 3%  [ 1 ]
Total Votes : 27

Author Message
blackrat



Joined: 12 Oct 2004
Posts: 18
Location: Vienna/Austria

PostPosted: Sun Oct 24, 2004 7:34 pm    Post subject: German problems Reply with quote

;=== BEGIN ScanStartMenu SUBROUTINE ...

After changing "Start Menu" to the term used in my language, the main problem seems, when the results of the dir command are written to file ">"

When opening the _Seek.list in "C:\Dokumente und Einstellungen\user-name\Lokale Einstellungen\Temp" you can see, that the special German chars cannot be displayed any more (a placeholder is there).

I think, this used technique is unfortunately not reliable (for non-English systems) and would need a complete workaround.
_________________
blackrat


Panoshots from Game-Screenshots
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Phi



Joined: 24 Sep 2004
Posts: 32

PostPosted: Mon Oct 25, 2004 9:56 am    Post subject: Reply with quote

blackrat, I'm sorry this isn't working for you. Sad I think you're right. The problem is probably caused by the 'dir' command of cmd.exe, which doesn't handle non-English unicode characters. The same thing happens when I try out on Chinese characters on my PC.

There is not going to be an easy solution to this. Besides finding an alternative method to properly output non-English characters from cmd.exe, AutoHotkey (and/or AutoIt) will also need to internally support non-ANSI character codes in the string manipulation functions. That will be a major overhaul. I'm not sure if this is part of Chris' todo list.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon Oct 25, 2004 11:46 am    Post subject: Reply with quote

I think I would like it to support Unicode someday, perhaps as a separate version because otherwise I think non-Unicode users would see a large increase in memory and a reduction in performance. This is based on flimsy evidence since I have no real experience working with wide characters.
Back to top
View user's profile Send private message Send e-mail
Phi



Joined: 24 Sep 2004
Posts: 32

PostPosted: Mon Oct 25, 2004 11:55 am    Post subject: Reply with quote

Quote:
I think I would like it to support Unicode someday

I will surely look forward to that day. Smile With it, AutoHotkey will be able to reach international audience.
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Sun Nov 14, 2004 3:12 pm    Post subject: Reply with quote

i use this script to search for my mp3s.

with a little change in the code i've added enhanced search. earlier typing 'michael' used to list 'michael jackson' and 'george michael' now if i want just 'george michael' then i'd have to delete and retype the search string to get 'george' before 'michael'... now i can just type 'mich geo' or 'michael geor' or 'geo mich' or any strings that appear anywhere in the path to get the correct results.

here's the code:

Code:
; APPEND MATCHING RECORDS INTO THE LIST
SplitPath, A_LoopReadLine, name, dir, ext, name_no_ext, drive
MatchFound = Y
                       
CurrentFile = %A_LoopReadLine%
                       
Loop, parse, sfmFilename, %A_Space%
       IfNotInString, CurrentFile, %A_LoopField%
              MatchFound = N
                       
IfEqual, MatchFound, Y
List = %List%%A_LoopReadLine%|


it can ofcourse be used in the same way for start menu searches.
the above searches the whole path and not just file name (helps me in searching for album name) but if u like it the old way then just remove the 'CurrentFile = %A_LoopReadLine%' line and replace 'IfNotInString, CurrentFile, %A_LoopField%' with 'IfNotInString, Name, %A_LoopField%'

this fuzzy searching could be a nice addition to the official seek.
_________________
Back to top
View user's profile Send private message
Phi



Joined: 24 Sep 2004
Posts: 32

PostPosted: Mon Nov 15, 2004 5:00 pm    Post subject: Good Idea Reply with quote

Thanks Rajat for the good suggestion. I've added it to Seek. The next version will get this fuzzy-search feature. Smile

Code:
; - Fuzzy search when user enters multiple query strings,
;   separated by space, for e.g. "med pla". It's a match
;   when all the strings ("med" & "pla") are found. This
;   will match "Media Player", "Macromedia Flash Player",
;   "Play Medieval King", "medpla", "plamed".
;   (Suggested by Rajat)
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Mon Nov 15, 2004 5:40 pm    Post subject: Reply with quote

This is an awesome script, I really like being able to search directories quickly and then being able to access it too. However, my first impression before I ran it was that it would activate the Programs menu, but disable the items that didn't match the query. I think something closer to a menu and less like an app would work better for me. It just seems a tad bit clunky right now. For me, the ideal would be something very close to Rajat's winamp script, except that it displays a menu with the results of the search. (Btw, good job on that rajat!) I'm going to start working on this a little bit myself, tell me if you think this is a good idea.
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Tue Nov 16, 2004 7:38 am    Post subject: Reply with quote

Quote:
For me, the ideal would be something very close to Rajat's winamp script, except that it displays a menu with the results of the search. (Btw, good job on that rajat!) I'm going to start working on this a little bit myself, tell me if you think this is a good idea.

sure... go ahead! ...and i'd quite forgotten about posting that script (though i use it often).
_________________
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 16, 2004 11:00 am    Post subject: Reply with quote

Wow... after taking a closer, look, I'm totally at a loss of how to do that. I've never worked with GUIs in AHK before. My next self-assignment: read up on both gui's and menus, come up with a solution.
Back to top
Phi



Joined: 24 Sep 2004
Posts: 32

PostPosted: Tue Nov 16, 2004 11:53 am    Post subject: Reply with quote

jonny, your approach is refreshing. Do post your script when it's ready. Can't wait to get a feel of how that really works. Smile
Back to top
View user's profile Send private message
S.F.
Guest





PostPosted: Wed Nov 17, 2004 12:03 am    Post subject: Reply with quote

Phi wrote:
blackrat, I'm sorry this isn't working for you. Sad I think you're right. The problem is probably caused by the 'dir' command of cmd.exe, which doesn't handle non-English unicode characters. The same thing happens when I try out on Chinese characters on my PC.

There is not going to be an easy solution to this. Besides finding an alternative method to properly output non-English characters from cmd.exe, AutoHotkey (and/or AutoIt) will also need to internally support non-ANSI character codes in the string manipulation functions. That will be a major overhaul. I'm not sure if this is part of Chris' todo list.


I found that the dir command's output of characters from the Extended Character Set (ANSI) has a one-to-one translation to the same characterset in all but 29 characters.
These 29 are all in the range 80 to 9f; the 3 exceptions in that range being 83, 86 and 87.
I would not expect any of these 29 to be found in the dir command's output on my systeem, maybe with the exception of the Euro symbol.

So I wonder if e.g. German users might be helped with a function that converts the other 99 characters.
Personally I would like to have such a function, that given a string would return the string with any of those 99 extended chars converted and an error if not completely succesful.

Does something like that already exist?

Cheers
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Wed Nov 17, 2004 1:26 am    Post subject: Reply with quote

I don't know if I fully understand the goal, but there are two functions built into Windows that seem related:
Quote:
The CharToOem function translates a string into the OEM-defined character set. The OemToChar function translates a string from the OEM-defined character set into either an ANSI or a wide-character string.

These functions can be added if anyone can demonstrate a scripting use for them.

Also, it might be useful in some cases to copy a Unicode string to the clipboard, and then reference the clipboard as %clipboard%, which I believe translates Unicode to ANSI (to the extent that a mapping can be found).
Back to top
View user's profile Send private message Send e-mail
S.F.
Guest





PostPosted: Thu Nov 18, 2004 9:05 pm    Post subject: Reply with quote

The Seek script has a problem with file names that contain chars from the Extended Characters Set.
Should you have e.g. a directory named Übersicht then none of the files therein are accessable for Seek.
Seek (or every script that depends on the output of the DIR command) could use at least a partial work-around for e.g. German or French users.

A (partial) work-around could be that the script e.g. in case of "File not found" would use a function that checks if the full file path as returned by DIR contains extended chars and then if possible converts those to the proper chars.
In the case of Übersicht it would find the char 9A and convert it to char DC = Ü, according to the conversion table below.
(I created a file with a name consisting of all "extended chars" and this is what DIR made of it.)

It shows in red the chars that cannot be handled this way.

80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F

80 3F 3F 27 9F 22 2E C5 CE 5E 25 53 3C 4E 3E 5E 3F
90 3F 27 27 22 22 07 2D 2D 7E 54 73 3E 6F 3F 7F 59
A0 FF AD BD 9C CF BD DD F5 F9 B8 A6 AE AA F0 A9 EE
B0 F8 F1 FD FC EF E6 F4 FA F7 FB A7 AF AC AB F3 A8
C0 B7 B5 B6 C7 8E 8F 92 80 D4 90 D2 D3 DE D6 D7 D8
D0 D1 A5 E3 E0 E2 E5 99 9E 9D EB E9 EA 9A ED E8 E1
E0 85 A0 83 C6 84 86 91 87 8A 82 88 89 8D A1 8C 8B
F0 D0 A4 95 A2 93 E4 94 F6 9B 97 A3 96 81 EC E7 98

I'm new to scripting and could probably create such a function, but that might be far from optimal.
And, if I may be blunt, I would like to have such a function for AutoIt as well.
I'm pretty sure I could make the latter myself once I have the framework, though.

A better solution would be to have a function that provides the same functionality as DIR /b /s (and preferrably accepting multiple paths like the WinXP DIR) but without this extended chars problem.
For AutoIt I came across _FileSearch somewhere, but for searching a complete hd with many files it is (too) slow.

The best solution I guess for both AutoIt and AutoHotkey would be having a fast built-in function like that.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Thu Nov 18, 2004 9:36 pm    Post subject: Reply with quote

Assuming I understand the problem correctly, I think this all goes back to the lack of Unicode support in AutoHotkey. I believe NTFS is capable of storing Unicode characters. Perhaps I can alter the file-pattern loop so that Unicode filenames are retrieved in some other way, perhaps UTF-8.

Thanks for mentioning this issue because it has cropped up before and I'm beginning to believe it's a priority to fix it (if there's an easy way).
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Thu Nov 18, 2004 9:48 pm    Post subject: Reply with quote

Well, the menu search idea is kind of hard to implement, I'm finding. Basically I'd have to re-write it from the top. While technically this shouldn't be too hard, I have no idea how to "extract" the code that does the actual searching. I didn't write the script, so it's much harder for me to see all the connections and references in it. At first glance, it seems like it is intimiately associated with the gui. If it wouldn't be too much trouble, could you write a segment that will simply search the directory(s) and output the content of it in a way that will allow me to make the menus? I'll be able to write the rest from that point. (I hope Very Happy)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 3 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group