Welcome!

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

SignUp Now!

How to use CLIP1: to CLIP9: with the Ditto Clipboard program.

Aug
1,929
71
Ref: Sharing CLIP1 to CLIP9 with another TCC

This could probably be modified to work with the Windows 10 Clipboard History,
but I will leave that for another time.

I currently CALL this .BTM from my CD_Enter alias.

Code:
@echo off
@setlocal

COMMENT
I have been using the Ditto Clipboard program
 for a number of years now.

You copy something to the Clipboard,
 and Ditto takes what you copied,
 and stores it in a database to retrieve at a later time.

This .BTM places the last 9 entries from the Ditto.db,
 to the TCC Clipboards 1 to 9.

Call this .BTM before using TCC Clipboards 1 to 9.

TCC Clipboards 1 to 9 only work with text.
 Thus,
 if there is a non-text item on Clipboards 1 to 9,
 it will display as follows when using the CLIP command;

 CLIP4: CF_DIB

Required to run this .BTM;
- TCC 29.00 or higher

- Ditto Clipboard program
  https://github.com/sabrogden/Ditto/wiki

- ISO8601 Plugin
  http://prospero.unm.edu/plugins/iso8601.html

- SQLite3 for reading the Ditto.db
  https://www.sqlite.org/index.html

- (Optional) A RAMDrive
ENDCOMMENT

::
:: Only run this .BTM with TCC Version 29.00 or higher
::
if %_4ver lt 29 quit

::
:: R:\ Drive is a RAMDrive
::
set temp=r:\temp
::
:: This .BTM records the last time it was executed.
::
set lasttime=%@iniread[%_batchname,Main,lasttime]

::
:: Only update if more than 1 minute has passed.
:: Change the wait time to your preference.
::
:: @makeage is a plugin command from ISO8601, not an internal command
::
if %@makeage[%_date,%_time] lt %@eval[%lasttime+300000000] quit

::
:: Change this to the location of your Ditto.db
::
set dbDitto=C:\Users\jlcav\AppData\Roaming\Ditto\ditto.db

set maxlid=%@execstr[sqlite3.exe %dbditto "select max(lid) from main"]
set minlid=%@eval[%maxlid-8]
set clip=1

do thelid=%minlid to %maxlid
  sqlite3.exe %dbditto "select mtext from main where lid = %thelid" > %temp\%thelid.clip
  type %temp\%thelid.clip > clip%clip:
  set clip=%@eval[%clip+1]
  del /q %temp\%thelid.clip
enddo

::
:: @makeage is a plugin command from ISO8601, not an internal command
::
set lasttime=%@iniwrite[%_batchname,Main,lasttime,%@makeage[%_date,%_time]]

endlocal

quit

[Main]
lasttime=133177440630000000
Joe
_x64: 1
_admin: 1
_elevated: 1

TCC 29.00.17 x64 Windows 10 [Version 10.0.19044.2364]
 
Back
Top