Swap Panes Macro

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
DerRickster
Member
Member
Posts: 9
Joined: 2015 Apr 24, 00:59

Swap Panes Macro

Post by DerRickster »

I harrassed Nikos for the code :D and I want to share it with the forum. Especially for the beginners in scripting.
It is written in such a way if only one pane is turned on, it wouldn't give you an error.

errorstop 0
command "swap panes"
jumperr error
exit
label error
# turn on dual pane first
command "dual pane"
wait 500
command swap

Also I created an icon for Swap Panes macro. Sorry I'm not a computer artist, I like natural media like Pens, Pencils and oil pastels.
Here is the png https://i.ibb.co/pRykFHj/swap-panes.png *Reworked*
Here is the online icon converter
https://icoconvert.com/
Enjoy and thanks Nikos!

P.S. Place the icon file in the xplorer2 directory. It will save you the hassle of finding it if it is in another directory and that directory is moved or deleted.
Last edited by DerRickster on 2020 Oct 30, 02:17, edited 3 times in total.
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Swap Panes Macro

Post by nikos »

good stuff, now see if you can debug this macro I'm battling with to automate a part of xplorer2 build process
this is good enough for a PhD in x2 macros :D

Code: Select all

# macro to automate building 7z out of the pdb files
#message "first you must do a context menu 7z to repeat it here"

#input "build number" hard to debug @@@
pop 4500
addstr ".7z"
store $6

pop debugUnicode
store $5
jsr subr
exit #@@@

pop release
store $5
jsr subr

pop Release_Unicode
store $5
jsr subr

pop Win32_Release_ULT
store $5
jsr subr

pop Release_Unicode_ULT
store $5
jsr subr

pop Release_AMD64
store $5
jsr subr

pop Release_ULT_x64
store $5
jsr subr

exit


# ---------------------------
# $5 is the name of the folder to enter
# $6 is the name for renaming the 7z created
label subr

# typing paths is flakey when a prior dialog INPUT was shown!?
#FINDWND address
#FINDCLASS combobox
#SETFOCUS
#SETTEXT $5
#SENDKEY enter
# jsr select1 can't do subs from within subs!
pop ":"
addstr $5
store $7 # :exact name

COMMAND 32932 # matching a rule
FINDWND "cl&ear"
CLICK
POP 0
FINDCLASS Edit
SETTEXT $7
OK
waitidle
COMMAND 32777 # enter folder
waitidle

errorstop 0 # we may not have any selection
COMMAND 32803 # unselect
waitidle
errorstop 1
COMMAND 32845 # select
POP 0
FINDCLASS Edit
#@@@ SETTEXT "xp*exe, xp*map, xp*pdb"
SETTEXT "ke*exe, ke*map, ke*pdb"
OK

waitidle
getfocus
#cmenu $5 # should be add to 7z
COMMAND 33125 # repeat shell
wait 10000 # archive created?

#make xxx.7z
pop $5
addstr ".7z"
store $5
#jsr select1
COMMAND 32932 # matching a rule
FINDWND "cl&ear"
CLICK
POP 0
FINDCLASS Edit
SETTEXT $5
OK
waitidle

COMMAND 32792 # rename
wait 1000
POP 0
# FINDCLASS Edit it's not the topmost
getfocus
SETTEXT $6
sendkey enter

wait 1000 # @@@ dbg
command "up a level"
ret 0
DerRickster
Member
Member
Posts: 9
Joined: 2015 Apr 24, 00:59

Re: Swap Panes Macro

Post by DerRickster »

Image
User avatar
nikos
Site Admin
Site Admin
Posts: 15771
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Swap Panes Macro

Post by nikos »

did you know that editor2 can do macros too?
https://www.youtube.com/watch?v=cItkkcUPEy0
Post Reply