Trigger Text Expander (Phrase File) by Pasted Content

Discussion, questions and support.
Post Reply
ismail
Posts: 1
Joined: Mar 5th, ’23, 10:57

Post by ismail » Mar 5th, ’23, 11:05

Hi. Thanks for the great programme!

I have a question.

When I copy and paste something, it doesn't occur automatically like when I type it manually by pressing keyboard keys.

To explain more detailed,

I have a Phrase File which have a list of employees name and their employee id. When I type an ID, it gets correctly name of the employee. But when I copy&paste the ID somewhere, it just doesn't work.
Example of My List:
E44542 Name1 Surname1
E12121 Name2 Surname2
E78783 Name3 Surname3
I want it to get Name1 Surname1 when I paste E44542 somewhere.

I'd be appreciated if you help me with this situation.
User avatar
Marko
Posts: 1718
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Mar 5th, ’23, 14:27

Interesting question. FastKeys is making substitutions by monitoring keyboard input so this does not work.

You can create a shortcut (Type: Command) with the script below. The script loads the phrase file (you need to change the path to your actual file) and then extracts the data based on the clipboard contents.

Code: Select all

FileRead, Output, C:\Users\UserName\Documents\FastKeys\Phrase Files\My Abbreviations.fkp
txt=%clipboard%
RegExMatch(Output, "i)::" txt "::(.*)", Result)
SendInput, % Result1
Output:=""
Post Reply