Posts: 1,769
Threads: 410
Joined: Feb 2003
I don't know whether this should be in the "Wish List" or here so i'll put it here for now and you can move it if you wish.
I have about 200 macros and have several main folders that i'd like to dump macros into once i move them out of testing and into production. is there a way to move a macro into a folder programatically? if so i'd love to put that into the context menu (ie right-click) with several of my folders as options.
Posts: 12,074
Threads: 141
Joined: Dec 2002
Function QmItemMoveToFolder
;\
function $folder
;Moves a macro to the folder.
;EXAMPLE
;QmItemMoveToFolder "\New\Users new"
def TVM_SELECTITEM (TV_FIRST + 11)
def TVGN_CARET 9
QMITEM q qc
int idf=qmitem(folder 0 q); if(!idf or q.itype!=5) mes- "folder not found"
int idcurr=qmitem("" 0 qc)
str s.format("Click the item within 10 s" folder)
OnScreenDisplay s 1
wait 10 ML ;err ret
Acc a=acc(mouse)
if(a.Role!=ROLE_SYSTEM_OUTLINEITEM) ret
;s=a.Name
;int iid=qmitem(s
int tv=id(2202 _hwndqm)
key Cx
SendMessage tv TVM_SELECTITEM TVGN_CARET q.htvi
key Cv
int h=wait(1 WA win("Quick Macros" "#32770" "" 0x401)); err ret
but 6 h
SendMessage tv TVM_SELECTITEM TVGN_CARET qc.htvi
SendMessage tv TVM_SELECTITEM TVGN_CARET q.htvi
SendMessage tv TVM_SELECTITEM TVGN_CARET qc.htvi
Posts: 1,769
Threads: 410
Joined: Feb 2003
Posts: 1,769
Threads: 410
Joined: Feb 2003
im now running 2.1.9.1 and this macro fails due to "Error in QmItemMoveToFolder: this name already exists." and highlights this line below.
def TVM_SELECTITEM (TV_FIRST + 11)
can you take a look at it?
thanks so much.
Ken
Posts: 12,074
Threads: 141
Joined: Dec 2002
Remove this line. It is not necessary. The error is because somewhere (not in System) TVM_SELECTITEM is defined slightly differently, eg WM_USER+11, or somewhere is used WINAPI.TVM_SELECTITEM or WINAPI2.TVM_SELECTITEM.
In next QM version I'll try to change def and ref behavior to avoid such conflicts.
Posts: 1,769
Threads: 410
Joined: Feb 2003
Thanks!
note: it also errored out on the line below it (same error), so i commented it out as well and it works just fine.