Assuming that you have a filename of a file in question (that you want to be displayed in QuickView) in the clipboard, the following command will do the trick:
usercmd.ini:How it works (example):
- copy a file name of one of the files in the active pane in the clipboard,
- place the cursor somewhere else (on other file),
- activate em_test_tc_command2 (e.g. from button bar),
- then:
--- cm_LoadSelectionFromClip (the first command in the commands chain) will select the file, which name is in the clipboard,
--- cm_GoToFirstEntry,cm_GoToNextSelected (the second, and third commands in the commands chain) will place the cursor on the said file,
--- cm_ClearAll (the fourth command in the commands chain) will remove the selection,
--- cm_SrcQuickview (the last command in the commands chain) will show the contents of the said file in the Quickview mode.
Notes:
The first, second, and third commands in the chain have no other purpose than to move the cursor on the file in question (there is no other known way to do that; then the fourth command clears the selection, thus clearing the traces of the command chain except the cursor positioning; in fact, the end user doesn't see that those commands are there, the user is just getting the result they needed).
In its turn, such a construction is required since the cm_SrcQuickview works only with a file under the cursor and doesn't accept arguments (such as filename; otherwise the entire command could be much simpler).
Example button:Or you can use just a button (without a user command in usercmd.ini):Note: as you can see, the command chain is native, no other tools/scripts are involved.
usercmd.ini:
Code:
[em_test_tc_command2]cmd=cm_LoadSelectionFromClip,cm_GoToFirstEntry,cm_GoToNextSelected,cm_ClearAll,cm_SrcQuickview
- copy a file name of one of the files in the active pane in the clipboard,
- place the cursor somewhere else (on other file),
- activate em_test_tc_command2 (e.g. from button bar),
- then:
--- cm_LoadSelectionFromClip (the first command in the commands chain) will select the file, which name is in the clipboard,
--- cm_GoToFirstEntry,cm_GoToNextSelected (the second, and third commands in the commands chain) will place the cursor on the said file,
--- cm_ClearAll (the fourth command in the commands chain) will remove the selection,
--- cm_SrcQuickview (the last command in the commands chain) will show the contents of the said file in the Quickview mode.
Notes:
The first, second, and third commands in the chain have no other purpose than to move the cursor on the file in question (there is no other known way to do that; then the fourth command clears the selection, thus clearing the traces of the command chain except the cursor positioning; in fact, the end user doesn't see that those commands are there, the user is just getting the result they needed).
In its turn, such a construction is required since the cm_SrcQuickview works only with a file under the cursor and doesn't accept arguments (such as filename; otherwise the entire command could be much simpler).
Example button:
Code:
TOTALCMD#BAR#DATAem_test_tc_command2WCMICON2.DLL010028
Code:
TOTALCMD#BAR#DATAcm_LoadSelectionFromClip,cm_GoToFirstEntry,cm_GoToNextSelected,cm_ClearAll,cm_SrcQuickviewWCMICON2.DLL0-1
Statistics: Posted by beb — 2024-02-01, 20:24 UTC