Jump to content

ClipPut Replacment


Recommended Posts

Hey all :mellow:

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

  • Moderators

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. :mellow:

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I have to admit this is not easy at all.. :mellow:

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 by Omga4000
Link to comment
Share on other sites

  • Moderators

Omga4000,

I have to admit this is not easy at all

Yes 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. :mellow:

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 by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Omga4000,

Glad I could help. :mellow:

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 by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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! :mellow:

P.S

What do I do with my empty file?

Could you send me the full file?

Edited by Omga4000
Link to comment
Share on other sites

  • Moderators

Omga4000,

That is the one. You will get the full abbreviation file when you install it. :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...