remin Posted July 4, 2014 Share Posted July 4, 2014 (edited) I switched almost all my scripts from autohotkey to autoit a year ago and I don't regret it I still have an active autohotkey script with all my autotext phrases p.e. #If (A_ComputerName = "PCNAME") :?*:\\me::myname@domain.com etc Is there a no way to switch them also to autoit? Edited July 4, 2014 by remin Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 4, 2014 Moderators Share Posted July 4, 2014 remin,I though we had already discussed this in >your post in this thread and my subsequent reply? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
remin Posted July 5, 2014 Author Share Posted July 5, 2014 remin, I though we had already discussed this in >your post in this thread and my subsequent reply? M23 Hi Melba, I was not sure if I wrote about this and couldn't find it. Maybe we can delete this thread and go on in the other thread? (btw I still haven't resolved this autotext thing) Remin Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 5, 2014 Moderators Share Posted July 5, 2014 remin,Now we are here let us stay here. What problems are you having with the 2 solutions I offered in the other thread: - 1. Use a variable to contain the expanded text:; Declare the content $sEM = "myname@domain.com" ; And use it like this $url = $sEM & "\section\item.html"$url will then hold myname@domain.comsectionitem.html-2. Use the Abbrev manager in SciTE4AutoIt3 to create an abbreviation which you can expand as you type. Look under the <Help - SciTE Help - SciTE4AutoIt3 - User Abbreviations> and <Help - SciTE Help - Extra Utilities - Abbrev Manager> to learn more. If you do not have the full SciTE4AutoIt3 package I highly recommend that you download it from here - you get lots of helpful utilities to help you code in AutoIt. M23P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
remin Posted July 5, 2014 Author Share Posted July 5, 2014 I wish all moderators in other forums were so nice as you are. Thanks for answering. $url will then hold myname@domain.com\section\item.html I don't know what to do with a variable like this What I want to do is writing p.e. "!me" which has te expand to "myname@domain.com" Last year I installed SciTE, looked in the help file, these abbreviations are only for the SciTe editor isn't it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 5, 2014 Moderators Share Posted July 5, 2014 remin,Gosh, thanks. So you want to expand text in other apps? Then take a look at Manadar's HotStrings UDF. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
remin Posted July 6, 2014 Author Share Posted July 6, 2014 Yes! Thank you Melba that is what I want. Do you know if it is possible to give an argument to the function to avoid to create a function for every hostring? p.e. HotStringSet("\\btw", example(1)) HotStringSet("\\ty", example(2)) Func example() Send("{BACKSPACE "activation_stringlength"}") Send("By the way") ;Send argument 1 Send("Thank you") ;Send argument 2 EndFunc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 6, 2014 Moderators Share Posted July 6, 2014 remin,I have never used the function so I cannot really comment - perhaps you would be better posting in the HotStrings thread itself. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
remin Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) Did so but I suppose there is no one there in the hotstring thread Edited July 8, 2014 by remin Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 8, 2014 Moderators Share Posted July 8, 2014 remin,It is Manadar's UDF - so you will have to wait until he is on-line. Just wait patiently until he pops in. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. And also bear in mind that what is important to you is not necessarily so to others. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
remin Posted July 8, 2014 Author Share Posted July 8, 2014 Yes I know. I was only kidding. I thought Manadar was on holiday Link to comment Share on other sites More sharing options...
Solution jvanegmond Posted July 14, 2014 Solution Share Posted July 14, 2014 Hi remin, This wasn't possible. However, it is now. Please get the latest hotstring UDF from my github and try this: #include "hotstring.au3" HotStringSet("\\btw", "example") HotStringSet("\\hi", "example") While 1 Sleep(100) WEnd Func example($hotstring) ConsoleWrite("example because of trigger: " & $hotstring & @CRLF) EndFunc Gr, Mana github.com/jvanegmond Link to comment Share on other sites More sharing options...
remin Posted July 16, 2014 Author Share Posted July 16, 2014 (edited) Thanks Manadar This works great. Now I can put all hotstrings in one function: #include <HotString.au3> HotStringSet("\\hi", example) HotStringSet("\\btw", example) While 1 Sleep(100) WEnd Func example($hotstring) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") If $hotstring = "\\hi" then Send("hello") EndIf If $hotstring = "\\btw" then Send("by the way") EndIf EndFunc Have you thought to add also the expanded text in HotStringSet? Like this: #include <HotString.au3> Dim $arguments[2] $arguments[0] = "hello" $arguments[1] = "by the way" HotStringSet("\\hi", example($arguments[0])) HotStringSet("\\btw", example($arguments[1])) While 1 Sleep(100) WEnd Func example($hotstring,$arguments) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") Send($arguments) EndFunc This makes the if/endif hotstring control unnecessary. Edited July 16, 2014 by remin jvanegmond 1 Link to comment Share on other sites More sharing options...
jvanegmond Posted July 16, 2014 Share Posted July 16, 2014 (edited) Nice job! I'm glad you like it. The reason for doing it this way is to keep the functionality of this new feature similar to AutoIt's @HotKeyPressed macro. So when a programmer realizes HotKeySet won't be enough, he can replace HotKeySet with HotStringSet and use the first parameter of the function instead of @HotKeyPressed. HotKeySet("a", "hotKeyCallback") HotKeySet("b", "hotKeyCallback") While 1 Sleep(500) WEnd Func hotKeyCallback() Switch @HotKeyPressed Case "a" ; Do 1 Case "b" ; Do 2 EndSwitch EndFuncBecomes#include "HotStrings.au3" HotStringSet("abc", "hotKeyCallback") HotStringSet("def", "hotKeyCallback") While 1 Sleep(500) WEnd Func hotKeyCallback($HotKeyPressed) Switch $HotKeyPressed Case "abc" ; Do 1 Case "def" ; Do 2 EndSwitch EndFuncWith only minor changes. Edited July 16, 2014 by Manadar remin 1 github.com/jvanegmond Link to comment Share on other sites More sharing options...
remin Posted July 16, 2014 Author Share Posted July 16, 2014 This would still be possible but maybe the if/endif code is easier: #include <HotString.au3> Dim $arguments[2][2] $arguments[0][0] = "\\btw" $arguments[0][1] = "by the way" $arguments[1][0] = "\\hi" $arguments[1][1] = "hello" HotStringSet("\\hi", example) HotStringSet("\\btw", example) While 1 Sleep(100) WEnd Func example($hotstring) local $lengte = StringLen($hotstring) Send("{BACKSPACE " & $lengte & "}") For $i = 0 To UBound($arguments) - 1 if $arguments[$i][0] = $hotstring then send($arguments[$i][1]) endif Next EndFunc jvanegmond 1 Link to comment Share on other sites More sharing options...
remin Posted July 16, 2014 Author Share Posted July 16, 2014 Happy to replace now all my previous Autohotkey hotstrings to autoit HotStringSet works great. The only difference I noted is that the Autohotkey hotstrings expander is much faster comparing to the Autoit HotStringSet (maybe because they don't use the send command?) and that it takes a bit more CPU during the text expanding in Autoit (5-6%), comparing to Autohotkey (0,5-1%) But it is not a great problem. Now I can use all my scripts in autoit. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 16, 2014 Moderators Share Posted July 16, 2014 remin,It looks as if the AHK implementation is in its core code, while HotStrings is a UDF, so it is hardly surprising that there is a speed and CPU load difference. M23 remin 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jvanegmond Posted July 16, 2014 Share Posted July 16, 2014 (edited) Ah, actually, what surprised me the most. It's not the HotString UDF that is taking up any CPU at all, but rather Send that is taking up quite a bit (which is how I assume you tested it).A quick test I made based on remin's example is this which takes up no (0%) cpu on my machine. #include <HotString.au3> HotStringSet("\\btw", "example") HotStringSet("\\hi", "example") HotStringSet("exit", "_exit") While 1 Sleep(100) WEnd Func example($a) ConsoleWrite($a & @CRLF) EndFunc ;==>example Func _exit() Exit EndFunc Edited July 16, 2014 by Manadar remin 1 github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted July 16, 2014 Share Posted July 16, 2014 remin,try playing with options SendKeyDelay and SendKeyDownDelay. This cut my CPU time in half and rather obviously made the typing insanely quick. Your mileage may vary.Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 1) WinActivate("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("I think Halo is a pretty cool guy. Eh kills aleins and doesnt afraid of anything.") Send("I think Halo is a pretty cool guy. Eh kills aleins and doesnt afraid of anything.") Send("I think Halo is a pretty cool guy. Eh kills aleins and doesnt afraid of anything.") github.com/jvanegmond Link to comment Share on other sites More sharing options...
remin Posted July 16, 2014 Author Share Posted July 16, 2014 (edited) ConsoleWrite() doesn't seem to work on my pc. Nothing happens. What did I wrong? Edited July 16, 2014 by remin Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now