Omga4000 Posted August 14, 2011 Share Posted August 14, 2011 Hey all As you can see, I'm pretty new to AutoIt so I will appreciate if you show some patient with me. So I simply wrote a code that stops the script whenever I press ESC: HotKeySet ("{ESC}", "Terminate") Func Terminate () Exit EndFunc I don't want to write this over and over every time I write a new script, so I was thinking of making a script that will simply copy this to the clipboard. The problem is "ClipPut" func doesn't allow {} or "Terminate". What do I do? Thank you Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2011 Moderators Share Posted August 14, 2011 Omga4000,I would save the code as an abbreviation within SciTE - then you can call it whenever you need it. I have lots of personal abbreviations added to the standard ones installed with SciTE. Look in the SciTE Help file under <SciTE/AutoIt3 - Abbreviation How To> to see how it is done. There are also some scripts in the Examples forum to help you automate the process, but you will have to search for them. Come back if you run into problems. 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...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 (edited) I have to admit this is not easy at all.. First - did you mean this? http://www.autoitscript.com/autoit3/scite/docs/abbrevHelp.htm What exactly are those abbreviations? What kind of "orders" can I give them? (Something = ?????) I assume I can't just write: hotkey= HotKeySet ("{ESC}", "Terminate") Func Terminate () Exit EndFunc What kind of command can I use to terminate the script? Is there a list of commdand I can add? And where are all of the example abbreviations? My file is empty. I know those are a lot of questions. Feel free to answer only part of them if that's too much.. Thanks a lot!! Edited August 14, 2011 by Omga4000 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2011 Moderators Share Posted August 14, 2011 (edited) Omga4000, I have to admit this is not easy at allYes it is! That is the correct Help page - so let us go through this slowly and you will soon see how to do it. 1. Open the abbreviations file via the <Options - Open Abbreviations File> menu in SciTE. Now you can see all the abbreviations that come with SciTE on installation. All we need to do is add our own - best to do it at the end of the file, so scroll down. The final abbreviation I see is wwna=WinWaitNotActive(|). 2. Now we will add your abbreviation to the list - let us call it hke (short for HotKeyEscape). Add a few blank lines under the final entry in the abbreviations file and type "hke=". Now we need to tell SciTE what to do when it expands the abbreviation, so we type the text we require, using \n for NewLine and \t for Tab. We end up with this: hke=HotKeySet("{ESC}", "Terminate")\nFunc Terminate()\n\tExit\nEndFunc 3. Now save the file and see what happens when you type hke and then press Ctrl-B. You should get the abbreviation replaced by the text. M23 Edit: Just seen your edit to say that the abbreviations file is empty. Are you using the full SciTE4AutoIt3 package? If not I recommend that you do - lots of extra goodies to help you code in AutoIt. You can download it from here. Edited August 14, 2011 by Melba23 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...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 You sure do make it simple 1. I've opened the file "abbrev.properties" and the file is empty. I see no commands at all there. 2. Done! 3. Works perfectly!! Thank you!! Melba23 you are a Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2011 Moderators Share Posted August 14, 2011 (edited) Omga4000, Glad I could help. I really do recommend the SciTE4AutoIt3 package - and not because Jos gives me a cut of the royalties. You get a lot of extra utilities to help you code in AutoIt and many of the tips you see in the forum will only work with the full version rather then the cut-down version of SciTE you get with the normal AutoIt install. M23 Edit: Typnig! Edited August 14, 2011 by Melba23 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...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 (edited) I will check it out as soon as I get back home. (this, right? http://www.autoitscript.com/site/autoit-script-editor/) Once again, thank you for the help! P.S What do I do with my empty file? Could you send me the full file? Edited August 14, 2011 by Omga4000 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2011 Moderators Share Posted August 14, 2011 Omga4000, That is the one. You will get the full abbreviation file when you install it. 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...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 Alright, so that's one case solved. Now what do I do if I really need to copy {} to the clipboard? How do I do that? Link to comment Share on other sites More sharing options...
JohnOne Posted August 14, 2011 Share Posted August 14, 2011 ClipPut("{}") Try in scite ClipPut("{}") Send("^v") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
smartee Posted August 14, 2011 Share Posted August 14, 2011 ClipPut("{}") MsgBox(64, Default, "Contents of clipboard: " & ClipGet()) Link to comment Share on other sites More sharing options...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 (edited) Well that worked However, this won't work: ClipPut(""{Terminate}"") Why won't it work? Why can't I copy quotation marks ("") to clipboard? Edited August 14, 2011 by Omga4000 Link to comment Share on other sites More sharing options...
smartee Posted August 14, 2011 Share Posted August 14, 2011 @JohnOne: @Omga4000: If you would like to place data from a file onto the clipboard you may want to have a look at FileRead() too. Something like this maybeClipPut(FileRead("HotkeyTemplate.au3")) Link to comment Share on other sites More sharing options...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 I would like to add, for example, the word Terminate with quotation mark. It's not possible with ClipPut for some reason. Check it out: ClipPut(""{Terminate}"") Link to comment Share on other sites More sharing options...
smartee Posted August 14, 2011 Share Posted August 14, 2011 You can, double up on the double quotes or bind them in single quotes likeClipPut("""{Terminate}""")orClipPut('"{Terminate}"') Link to comment Share on other sites More sharing options...
Omga4000 Posted August 14, 2011 Author Share Posted August 14, 2011 After seeing this simple solution I feel so dumb Thank you all, you've really helped me! More questions are sure to come. what a great program! 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