Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use QM code to replace in QM editing area
#1
Hello, I want to create an AutoText. When I type cs and press Enter, it will replace all $cel with $sel in the QM editing area of ​​the currently item .

I can use the search replacement panel to achieve the above goals, but it is more convenient to use QM code + AutoText, thank you in advance.


Autotext Autotext1
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/m
cs :sub.Sub1 ;;replace $cel to $sel


#sub Sub1 m

;Example: case "$cel_$inp_Name$$"
;
;QM code:
#2
Has been tested successfully Smile


Autotext Autotext1
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/b/i/c/m
cs :sub.Sub1 ;;replace $cel to $sel


#sub Sub1 m

;Example: case "$cel_$inp_Name$$"
;QM code:
int h=GetQmCodeEditor
SendMessage(h SCI.SCI_SELECTALL 0 0)
SendMessage(h SCI.SCI_COPY 0 0)
_s.getclip()
_s.findreplace("$cel" "$sel")
_s.setclip
SendMessage(h SCI.SCI_PASTE 0 0)


Forum Jump:


Users browsing this thread: 1 Guest(s)