macro baby steps

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 151
Joined: 2002 Aug 22, 00:02

macro baby steps

Post by jimspoon »

I've had the goal of copying all paths open in both panes, and pasting them into the Mini-Scrap. Manually I can do this by right-clicking a tab in the left pane, Copy All Paths, click Mini Scrap, paste, right-click tab in right pane, copy all paths, click Mini-Scrap, paste.

Then I thought I would try to do this with a macro. I've had a hard time of it but it's been educational, and I"m getting closer.

Here is the latest revision of my macro (littered with MESSAGE $0 lines), with the debug output for each line indented below the macro line:

Code: Select all

ERRORSTOP 0
FINDWND "Left pane settings"
	2: hwC212DC class=SysListView32, ID=59648 [Left pane settings]
MESSAGE $0
	hwC212DC class=SysListView32, ID=59648 [Left pane settings]
SETFOCUS
MESSAGE $0
	hwC212DC class=SysListView32, ID=59648 [Left pane settings]
PARENTWND
	6: hw570BF6 class=WTL_Miller, ID=59652
MESSAGE $0
	hw570BF6 class=WTL_Miller, ID=59652
SETFOCUS
MESSAGE $0
	hw570BF6 class=WTL_Miller, ID=59652
FINDCLASS WTL_DNTabCtrl
	10: hw40942 class=WTL_DNTabCtrl, ID=59651
MESSAGE $0
	hw40942 class=WTL_DNTabCtrl, ID=59651
SETFOCUS
MESSAGE $0
	hw40942 class=WTL_DNTabCtrl, ID=59651
CMENU "Copy all paths"
	14: #33134
MESSAGE $0
	#33134
INPUT 0
	16: C:\test1,C:\test2
MESSAGE $0
	C:\test1,C:\test2
FINDWND "Mini scrap settings"
	18: hw308A2 class=SysListView32, ID=59406 [Mini scrap settings]
MESSAGE $0
	hw308A2 class=SysListView32, ID=59406 [Mini scrap settings]
SETFOCUS
MESSAGE $0
	hw308A2 class=SysListView32, ID=59406 [Mini scrap settings]
COMMAND Paste
	22: paste #57637 Insert Clipboard contents Paste (Ctrl+V)
MESSAGE $0
	paste #57637
	Insert Clipboard contents
	Paste (Ctrl+V)
FINDWND "Right pane settings"
	24: hwE08AA class=SysListView32, ID=59649 [Right pane settings]
MESSAGE $0
	hwE08AA class=SysListView32, ID=59649 [Right pane settings]
SETFOCUS
MESSAGE $0
	hwE08AA class=SysListView32, ID=59649 [Right pane settings]
PARENTWND
	28: hw140930 class=WTL_Miller, ID=59653
MESSAGE $0
	hw140930 class=WTL_Miller, ID=59653
SETFOCUS
MESSAGE $0
	hw140930 class=WTL_Miller, ID=59653
FINDCLASS WTL_DNTabCtrl
	32: hwE12EA class=WTL_DNTabCtrl, ID=59652
MESSAGE $0
	hwE12EA class=WTL_DNTabCtrl, ID=59652
SETFOCUS
MESSAGE $0
	hwE12EA class=WTL_DNTabCtrl, ID=59652
CMENU "Copy all paths"
	36: #0
		ERROR: 5
MESSAGE $0
FINDWND "Mini scrap settings"
MESSAGE $0
SETFOCUS
MESSAGE $0
COMMAND Paste
MESSAGE $0
I don't know why line 36 has #0 as its output, I haven't figured out what Error 5 is, the help page on macros doesn't explain that one. It's odd, because at that point the right pane is highlighted, and I can right-click on a tab and do copy all paths. It worked for the left pane, why not the right?
User avatar
nikos
Site Admin
Site Admin
Posts: 15794
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: macro baby steps

Post by nikos »

I am not sure why it fails but try to avoid using CMENU if there's another way. For example you can use this command directly

Code: Select all

COMMAND 33134 # copy all paths
so just activate the left view, copy the paths, then do the same for the right pane (without searching for tabs)
User avatar
jimspoon
Bronze Member
Bronze Member
Posts: 151
Joined: 2002 Aug 22, 00:02

Re: macro baby steps

Post by jimspoon »

Thanks Nikos, I should have thought of that, but I had my blinders on.

What is Error 5? Errors 1 through 6 are described at https://www.zabkat.com/x2h_7a.htm#pr_macro - all except for Error 5 !!
User avatar
nikos
Site Admin
Site Admin
Posts: 15794
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: macro baby steps

Post by nikos »

error 5 is a timeout
Post Reply