The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a list of all AutoText files in the left pane
#1
In order to make the AutoText definition easier, I wrote the following code. There are four pieces of code. I don't understand how to write it. I hope someone can provide some suggestions. Thanks in advance. Smile
_________________________________________________________
Because the private function TO_Text inside QM cannot be used, most of the code uses simulation operations, I think there should be a simpler method.

The following code is usable, you need to open the AutoText file first, then position the cursor behind the last acronym field. Operation is not convenient  Confused


Macro Add AutoText
Trigger CSAa     Help - how to add the trigger to the macro
Code:
Copy      Help
str s.getsel

str s1 ;;string variable. If need numeric, replace str with int or double.
if(!inp(s1 "Enter AutoText Abbreviation" "" "text")) ret
str s2 ;;string variable. If need numeric, replace str with int or double.
if(!inp(s2 "Enter a phrase description" "" "description")) ret
;
;1.code:Get a list of all AutoText files, The code below is an example, Suppose there are four AutoText files.

sel(ListDialog("Autotext1[]Autotext2[]Autotext3[]Autotext4"))
,case 1
,goto insert
,case 2
,goto insert
,case 3
,goto insert
,case 4
,goto insert
,case else ret

;insert

;2.code:Open selected Autotext??? file
;3.code:The cursor is positioned at the end of the last AutoText field

int w=win("QM TOOLBAR" "QM_toolbar")
act w
lef 12 9 id(9999 w) 1 ;;toolbar, press button 'Text'

paste s

int w1=win("Text" "#32770")
lef 9 7 id(6 w1) 1 ;;Check box 'Multiline'
lef 48 4 id(5 w1) 1 ;;List, list item 'Paste (use clipboard)'

;4.code:Replace the default Abbreviation with the variable s1, Add a description with the variable s2

When I enter an abbreviation, there may be some circumstances that need to be judged. For example, if the entered abbreviation already exists, the user is prompted to change it. If the user confirms, the selected row is inserted in the next line where the abbreviation already exists


Messages In This Thread
How to get a list of all AutoText files in the left pane - by win - 03-20-2019, 02:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)