How to send formatted/rich data (formatted text, links, images, etc)

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: How to send formatted/rich data (formatted text, links, images, etc)

How to send formatted/rich data (formatted text, links, images, etc)

by list » 22 Jul 2015, 15:22

How to send formatted/rich data (formatted text, links, images, etc)

Using standard Hotstrings (expand abbreviations as you type them (auto-replace)) and Hotkeys combined with Send you can of course send regular text, but what about formatted text, bold, italics, tables, bullet lists, images, links?

This brief tutorial will describe the available methods to be able to do this, mostly linking to specific post with usable scripts.

Other suggestions welcome of course.

[ shameless self promotion ]
If this is all too much trouble, you can of course always install Lintalist - http://lintalist.github.io/ which can use HTML, Markdown, RTF and Images :-)
(Lintalist uses the WinClip() technique)
[/ shameless self promotion ]


1 - Send keystrokes such as ctrl-b or ctrl-i for bold and italics
2 - Copy & Paste
3 - How to paste an Image?
4 - Using WinClip()
5 - Using Office files

1 - Send keystrokes such as ctrl-b or ctrl-i for bold and italics

Code: Select all

; be sure to try this is with an application where ctrl-b will start "bold",
; most office applications or email programs for example.
::test::We want to ^bthese words bold^b but also ^isome italics^i would be possible
2 - Copy & Paste

For this method you will need two scripts:

Script 1

Select some formatted text and/or image(s) in for example MS Word or your browser and press winkey-z, this will save the ClipboardAll variable to a file which you can later read back. You only have to do this once.

Code: Select all

#z::
Send ^c ; copy selected text and images to the clipboard
FileAppend,  %ClipboardAll%, CopiedData.clip
Return
Script 2

Now you can read back the formatted text and/or image(s) back into the clipboard by using the *c option of the FileRead command

Code: Select all

#v::
FileRead, Clipboard, *c CopiedData.clip
Sleep 200 ; give the clipboard some time to receive the data
Send ^v ; paste the data we have just read from the file
Return
Tip: see the Clipboard documentation for a trick to store and restore the current clipboard contents

3 - How to paste an Image?

3a: Using GDI - http://ahkscript.org/boards/viewtopic.p ... 326#p17326
3b: Using irfanview - http://ahkscript.org/boards/viewtopic.p ... 326#p17326

4 - Using WinClip()

WinClip is a clipboard manipulation class which allow you to do a bit more than the common ahk clipboard can written by Deo:
http://www.autohotkey.com/board/topic/7 ... pulations/

4a: Working example HTML http://www.autohotkey.com/board/topic/7 ... ntry502253
4b: Working example RTF http://www.autohotkey.com/board/topic/7 ... ntry502267

5 - Using Office files

MS Word example http://www.autohotkey.com/board/topic/7 ... ntry494436

Top