Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Use the Windows Clipboard as a pop-up list

Aug
1,948
71
Yes, there are other methods of creating a pop-up in TCC, for example, using @SELECT, etc.

This is just to demonstrate another method.

If you utilize the Windows Clipboard History with the WIN+V key combo, you can create a pop-up list for the TCC console.

Copy the text for the pop-up list to the clipboard.

1657467828625.png


Run your command, and then press the WIN+V key combination.

1657467871780.png


Select the item from the pop-up list, and press the Enter key.

1657467982640.png


Here it is in a .BTM, which will auto-activate the pop-up list.
Code:
@setlocal
@echo off
::Note
::GoTo Test
::Note

echo Populating the clipboard with a list of items...
echo Adding foo1.txt to the clipboard list
> clip: echo foo1.txt
delay /m 500
echo Adding foo2.txt to the clipboard list
> clip: echo foo2.txt
delay /m 500
echo Adding foo3.txt to the clipboard list
> clip: echo foo3.txt
delay /m 500
echo Adding foo4.txt to the clipboard list
> clip: echo foo4.txt
delay /m 500
echo Adding foo5.txt to the clipboard list
> clip: echo foo5.txt
delay /m 500
keystack LWin-V
input Enter the file name:  %%fname
echo %fname
endlocal

quit

::Without the Delay, each item is either skipped, or appended to the clipboard
::Example:
:Test
> clip: echo foo1.txt
> clip: echo foo2.txt
> clip: echo foo3.txt
> clip: echo foo4.txt
> clip: echo foo5.txt
keystack LWin-V

quit
     _x64: 1
   _admin: 1
_elevated: 1

TCC  28.02.18 x64   Windows 10 [Version 10.0.19044.1766]

Joe
 
Back
Top