AnemosCiel / SendText

SendText is an AutoHotkey v2 script that simplifies the management of your hotstrings and text snippets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SendText

SendText is an AutoHotkey v2 script that simplifies the management of your hotstrings and text snippets.

The script includes 155 built-in symbols and special characters and allows for the quick and easy addition of new texts and hotstrings.


Features

  • send texts via win32 menus or using hotstrings
  • manages categories, menu items, and hotstrings from one file
  • can be integrated easily into your own existing config, menu
  • emoji support: ๐Ÿ˜‰
  • old school ascii texts: เฌ˜(เฉญหŠแต•ห‹)เฉญโ€Šฬ€ห‹ ษชษดแด›แด‡ส€ษดแด‡แด›!
  • long text support
  • warn compatible

How to use it?

Please note โ˜ this script #Requires AutoHotkey >=2.0.

  1. Download both SendText.ahk and hotstring.ini into the same folder.

  2. Run SendText.ahk

  3. Hold Mbutton down for at least 500 ms or press simultaneously Win + c to show the menu.

  4. Select an element and the text will be pasted into the last active window.

    โต Alternatively, you can call the snippets via hotstrings.

By default, all hotstrings start with the semicolon : character. You can alter this value.

Texts & hotstrings in the ini file:

The scripts contain 100+ built-in texts, special characters, and symbols categorized by 8 main categories.

The following picture represents one category, a set of hotstrings, and item menus.

[Emoji faces]

eyes                     | eyes, rolleyes, check        | ๐Ÿ‘€
smile                    | smile, grin                  | ๐Ÿ˜
crying out loud          | cryingoutloud, col           | ๐Ÿ˜‚
smiling eyes             | smilingeyes                  | ๐Ÿ˜„
open mouth               | openmouth                    | ๐Ÿ˜ƒ
joy                      | joy, tears                   | ๐Ÿ˜‚
rolling on the floor     | rofl                         | ๐Ÿคฃ
laughing hand            | laughing                     | ๐Ÿคญ
embarassed               | embarassed                   | ๐Ÿ˜Š
halo                     | halo, saint                  | ๐Ÿ˜‡
upside down              | upsidedown                   | ๐Ÿ™ƒ
winking                  | wink                         | ๐Ÿ˜‰
relived                  | relived                      | ๐Ÿ˜Œ
love eyes                | love                         | ๐Ÿ˜
delicous                 | delicious, toungue, yummi    | ๐Ÿ˜‹
sunglasses               | sunglass, cool               | ๐Ÿ˜Ž
hearths                  | hearth                       | ๐Ÿฅฐ
thinking                 | think                        | ๐Ÿค”

Here are a few examples of each category:

  • [Roman Numerals] I, II, III, IV, ...
  • [AutoHotkey] keystrokes with Send()
  • [Brackets] ใ€”...ใ€•, โŒœโŒ, ...
  • [ASCII texts] เฌ˜(เฉญหŠแต•ห‹)เฉญโ€Šฬ€ห‹ ษชษดแด›แด‡ส€ษดแด‡แด›!, (า‚^.^)แ•ค, ...
  • [ASCII symbols] โต, โŸซ, โŠ™, โ‚ฌ, โˆ‘, ...
  • [Emoji symbols] โœ”, โ›…, โฐ, ...
  • [Emoji faces] ๐Ÿ‘€, ๐Ÿ˜, ...
  • [Emoji hands] ๐Ÿค™, ๐Ÿ‘, ...

Define a New Menu Category

Simply put [NewCategory] into the ini file.

All lines under NewCategory until the next Category will be listed in the NewCategory menu.

Spaces can be used.

[NewCategory]
...
texts
...
[NextCategory]

Closing the category tag is not necessary. Omitting NextCategory will set Newcategory to the last category.

Creating Menu items

Menu items can be created using the following format.

By default, the delimiter is the pipe | character.

displayed text | menu item title | hotstring | ahk code

For example: perfect | ok, perfect | ๐Ÿ‘Œ will create a menu item.

The displayed text in the menu will be perfect A_Tab ๐Ÿ‘Œ.

The third column indicates there are two hotstrings for this text. (separate the hotstring with a colon "," or ", " )

Typing either :ok or :perfect will display ๐Ÿ‘Œ.

Send support

Sending hotkeys is supported by using the * character as the first character in the fourth column.

This way AutoHotkey will send the strings using the built-in Send command.

This helps to send not just strings/texts but hotkeys too.

- example 1 -

... | ... | ... | *; {# 42}

will send (display) the following text:

; ##########################################

- example 2 -

Combine multiple hotkeys this way, e.g

Please note, the default keystrokes in the ini file are for Visual Studio Code. โ˜

... | ... | ... | *(x = y) ? 1 : 0{Home}{Right}{ShiftDown}{Right 5}{ShiftUp}

Will display

(x = y) ? 1 : 0 and the selected string will texts x = y.

- example 3 -

Typing :for will send the following string with AHK Send() function:

"for k, v in obj {{}{Enter}{Left 2}{Tab}{Up}{End}{Left 2}{ShiftDown}{Left 3}{ShiftUp}"

and will send

for k, v in obj {
    
}

And the obj phrase will be selected automatically.

- example 4 -

Typing :if will send:

"if (condition) {{}{Enter}{Down}{End}{Space}else{Space}{{}{Enter 2}{}}" "."

"{Up 4}{Home}{Right 4}{CtrlDown}{ShiftDown}{Right}{CtrlUp}{ShiftUp}"

And will create a standard if-else block:

if (condition) {

else {

}

And reselect the condition word.

Reselect a word

You can use standard hotkeys like reselection.

Using {CtrlDown}{ShiftDown}{Left}{CtrlUp}{ShiftUp} or {CtrlDown}{ShiftDown}{Left}{CtrlUp}{ShiftUp}

will reselect a word.

Sending longer texts

In the fourth column copy the text you want. (without * as the first chr)

... | ... | ... | ImagineThisIsAVeryLongText

This way the fourth element content will be copied to the clipboard and will be sent by using the clipboard.

After a successful paste the previous (saved) clipboard content will be restored.

Add to your existing menu

Copy the SendText() function to your script.

Call Texts := SendText()

Add to your menu with: YourMenuName.Add("Texts", Texts)

AHK - IniRead

Unfortunately, AutoHotkey v2 IniRead function does not support UTF-16 (Emoji characters), on the other hand, FileRead works.

About

SendText is an AutoHotkey v2 script that simplifies the management of your hotstrings and text snippets.

License:MIT License


Languages

Language:AutoHotkey 100.0%