How to check font type of Clipboard?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Scr1pter
Posts: 373
Joined: 06 Aug 2017, 08:21
Location: Germany

How to check font type of Clipboard?

22 Jun 2018, 06:26

Hi guys,

I know how it is possible to let AHK find out whether the Clipboard contains text or not.

Code: [Select all] [Download] GeSHi © Codebox Plus

F1::
if not (DllCall("IsClipboardFormatAvailable", "Uint", 1) OR DllCall("IsClipboardFormatAvailable", "Uint", 13)) ; if there is no text:
{
MsgBox, No text was copied!
ExitApp ; Close script
}


However, I would like to know if/how it's possible to find out the format of the text.
Would be interesting if AHK could check if it's underlined, italic or bold.
(Font color is not that important, yet interesting to know if that would be possible as well.)

I tried different types of this:

Code: [Select all] [Download] GeSHi © Codebox Plus

F7::
if Clipboard contains bbold
{
MsgBox, text is bold
}
return

(Also tried ^bbold^, ^bold)

It would be very helpful because I copy a lot of text from Excel.
Depending on its font format, I could use different functions.

Regards
I'm not an expert, just an enthusiastic AutoHotkey user. 8-)
Please do not support cheaters!
Keyboard: Logitech G15 first generation - Mice: Logitech G9, G502, G602 - OS: Windows 7 Pro 64 Bit - AHK version: 1.1.29.00
YMP2
Posts: 43
Joined: 20 Apr 2014, 06:55

Re: How to check font type of Clipboard?

22 Jun 2018, 07:09

1 and 13 are plain text formats, which means no formating, only character codes. There is also 7, CF_OEMTEXT. They are apparently not the formats you need. You can use InsideClipboard to see what formats Excel puts on the clipboard when you copy from it.
swagfag
Posts: 1098
Joined: 11 Jan 2017, 17:59

Re: How to check font type of Clipboard?

22 Jun 2018, 10:18

tested with word 2016

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Ask For Help”

Who is online

Users browsing this forum: Flipeador, lazynoob, TAC109 and 72 guests