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
#6
The following code works fine, currently only the last step of the code   Tongue

I think the code in the third and fourth steps is very difficult. It needs to read some fields of the file, then analyze the file positioning cursor, and finally write the characters to the corresponding position. Undecided


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
QMITEM q; int i
ARRAY(str) atn
ARRAY(int) htvi
rep
,i=qmitem(-i 1|16 &q 1|2|4|8)
,if(i=0) break
,if q.itype=4
,,atn[]=q.name
,,htvi[]=q.htvi
_s=atn
int ii=ListDialog(_s); if(ii=0) ret
;2.code:Open selected Autotext
SendMessage id(2202 _hwndqm) TVM_SELECTITEM TVGN_CARET htvi[ii-1];; opens autotext file selected in list dialog

TO_Fav "TO_Text" 0 0
int w1=act(win("Text" "#32770"))

;3.code:The cursor is positioned at the end of the last AutoText field

paste s
but id(6 w1) ;;check box 'Multiline'

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


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

Forum Jump:


Users browsing this thread: 2 Guest(s)