简体   繁体   中英

Can Dragonfly be used to modify existing text, like “Capitalise That” in DNS does?

As an example, I have written a simple rule to camelCase text. It uses the following spec:

spec="camel case <txt>"

which correctly modifies the text said after the command 'camel case'.

But this still isn't as flexible as built-in commands like "Capitalise That" are.

For example, "Capitalise That" can be used to operate on the text currently selected by the mouse. That makes it very easy to edit existing code.

Can this functionality be achieved in dragonfly?

Yes, but you'll have to get creative. Use a Dragonfly Function Action to press keys to highlight the text you want to capitalize. (For example, Shift-Right or Control-Shift-Left.) While still in the function called by the Function Action, read the text by sending keys for Control-C, then getting the contents of the clipboard. Then you can modify it however you want and print it back out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM