🅰️HK Lesson #18: Working with the Clipboard in 🅰️utoHotkey.

Hello,

Often it is very helpful to use the clipboard as a means for interacting with a program. Thankfully AutoHotkey has two built-in variables working with it:

A_Clipboard which reflects the content of the clipboard if it can be expresses as text

ClibpoardALL which contains a lot of different types of data (Images, files, HTML, Audio files, Video file, Rich Text Format/ RTF, etc.)

In this example we’re just going to play a little with Setting and Using A_Clipboard.

The following will send the selected text to the clipboard and then display it in a messagebox.

Send “^c” ;Copying selected text

msgbox A_Clipboard ; Display clipboard in a message box

We cover how to use the FileRead command in our Intermediate AHK v2 Course. Remember that you can get a 15% discount by clicking here.

One thing I like to make sure I do is backup my clipboard, use it with my program, and then restore the clipboard. I walk through this process in this video.

Having programmatic access to the clipboard is crazy useful! There are a lot of other things to learn about accessing and using the clipboard but this gives you the basics to get you started.

Additional Resources

Joe, Isaias, Irfan & Team

the-Automator.com

This campaign was designed to allow you to jump around. At any time you can jump to any one of the emails by clicking below

1) Intro2) AHK Versions3) Editors4) First AHK Script5) Getting Help
6) Variables7) Run @ Startup8) Downloading Viruses9) HotStrings10) Hotkeys
11) One vs Many Scripts12) Intro to QAP13) Functions & Directives14) Custom Functions15) Includes & Lib
16) Troubleshooting17) Intro to GUIs18) Using Clipboard19) Reading Files20) Saving Preferences
21) Automating older Progs22) Automating Menus

P.S. Using the clipboard to get stuff done is great, but we have talked about 18 different ways to automate programs in the AHK Hero Group❗

Comments are closed.