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 

Prevent hotstring duplicates
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Thu Jan 27, 2005 3:01 pm    Post subject: Reply with quote

I thought about using the built-in Sort command to remove duplicates, but it's not really appropriate for this particular task. This is because you would want each duplicate to be reported to the user as it is encountered. The sort command can remove all duplicates, but it would not tell you exactly what items it removed.
Back to top
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Fri Jan 28, 2005 12:05 am    Post subject: Reply with quote

Andreas Borutta wrote:
Quote:
Please could you explain in some simple words, what your scripts do - in comparison to the "original" on
http://autohotkey.com/docs/Hotstrings.htm. Thanks.


HotString is the script which contains your hotkeys.
At the first line it keeps an index of all used/set hotkeys which are listed below of it. If you press ALT+F9 it will call HotStringCreator.ahk

HotStringCreator will ask you to input your new hotkey. Format: <abbreviation> = <expanded abbreviation>
e.g. btw = baden tut weh
1) it will take that string and splits it.
2) will read the first line/index of HotString.ahk and check if the abbrev taken from the inputvar already exists within that index.
3) if yes - rejection
4) if no - it adds ...
- the new abbrev to update the index line
- it adds the new hotkey
- it writes both to HotString.tmp
5) all other existing hotkey will be "copied" to HotString.tmp as well

Done. No double entries.

BTW: I havn't known Chris' sample code Embarassed . Formerly I had an intro before my previous code section. Something like: "I'm faster writing the below code snippet as to read that whole thread" Wink .
Back to top
Andreas Borutta



Joined: 23 Jan 2005
Posts: 47

PostPosted: Fri Jan 28, 2005 1:29 am    Post subject: Reply with quote

@BoBo

Thanks for your explanation.

For me the feature of using "a selected text with several lines" is essential.
The complete (updated since the first posting) sketch for the script you find on
http://borumat.de/autohotkey-issues.php#hotstring4me

Please tell me, if something in the sketch isn't clear.

May be you or someone else likes the idea and likes to code the script - based on the existing scripts in this thread.

Maybe one thing isn't possible at the moment, if I understand Chris correctly:
*extracting the processname automatically

I suggested the processname as condition because in some cases the window-titles are configured by the user.
For example: in Firefox and Thunderbird I disabled the postfix in the titlebar because the readability of the title increases.
_________________
Andreas

http://borumat.de/autohotkey-autotexte-und-makros-tipps (german)
http://borumat.de/thunderbird-email-tipps (german)
http://borumat.de/firefox-browser-tipps (german)
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Fri Jan 28, 2005 11:10 am    Post subject: Reply with quote

@ Andreas Borutta
first of all I would appreciate if Chris could move this thread to the Support Area as it has left the status of a "command wished to be implemented in AHK" but has become a workaround. Please confirm.
Thx for listening. Smile

Quote:
Please tell me, if something in the sketch isn't clear

Ich interpretiere folgendes: du möchtest eine Textzeile selektieren und dieser anschließend einen Hotstring zuweisen ?
Back to top
Andreas Borutta



Joined: 23 Jan 2005
Posts: 47

PostPosted: Fri Jan 28, 2005 11:57 am    Post subject: Reply with quote

Quote:
Please confirm.

If you like to move the thread: I don't mind. Smile

Quote:
Quote:
Please tell me, if something in the sketch isn't clear

Ich interpretiere folgendes: du möchtest eine Textzeile selektieren und dieser anschließend einen Hotstring zuweisen ?

Fast. Nicht nur eine Zeile, sondern auch mehreren Zeilen.
Die Skizze in deutscher Sprache:
http://borumat.de/autohotkey-makro-und-autokorrektur-tipps.php#verbesserung-des-skriptes-hotstring4me
_________________
Andreas

http://borumat.de/autohotkey-autotexte-und-makros-tipps (german)
http://borumat.de/thunderbird-email-tipps (german)
http://borumat.de/firefox-browser-tipps (german)
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Fri Jan 28, 2005 4:42 pm    Post subject: Reply with quote

BoBo wrote:
move this thread to the Support Area as it has left the status of a "command wished to be implemented in AHK" but has become a workaround. Please confirm.
I think it's enough of a wish list item to stay here. I know a lot of topics cover a lot of territory and thus have no clear category, but generally I don't move them if they started off in the right category.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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