Anyone who needs to work productively on a PC will probably appreciate an external clipboard manager.
There are some very good clipboard managers out there, I eventually got stuck with Ditto and CopyQ, which are more or less in the same league. Both are awesome tools.
For now I'm using CopyQ again, although it's constantly changing. CopyQ can be adapted a little more to your own needs, but Ditto is a little easier to use. But if you want to get the most out of these clipboard managers, you have to delve deeper into both.
As I said, at the moment I am using CopyQ at daily work and I would like to present a few scripts that I'm using and that I did not find on the net in this form.
Here we go:
Tab Switcher:
Move To Tab:
Tab for EMails:
A script that examines the clipboard entry for an email address when copying it and moves it to a tab called EMails.Tab for YouTube Videos:
A script that examines the clipboard entry for a YouTube URL when copying it and moves it to a tab called YouTube within URL main tab. This script is based on a script called Tab for URLs with Title and Icon from this repository. Only the check for YouTube URLs has been added.Delete items after expire date:
Note1: This script is an add-on for a script called Store Copy Time. Therefore the script 'Store Copy Time' must be installed. You can download it from the offcial repository: https://github.com/hluk/copyq-commands/tree/master/Automatic
copyq:
// (main) tab for storing clipboard
var tabname = 'Zwis&chenablage';
// for safety -> you can uncomment this line if this script is working with your CopyQ environment
var tabdel = 'DeletedItems';
// NOTE: This script is an add-on for the script called Store Copy Time, it will not work without that script!
// https://github.com/hluk/copyq-commands/blob/master/Automatic/store-copy-time.ini
// must be equal to the mime string of 'Store Copy Time' command
// because the stored datetime will be extracted from this unique field!!!
var mimestring = 'application/x-copyq-user-copy-time';
const msPerDay = 24 * 60 * 60 * 1000; // Number of milliseconds per day
const today = new Date(Date.now())
// default expire days
var maxdays = 200;
var ndays = dialog(
'.title', 'Delete items >= x days?',
'Enter days', str(maxdays),
)
if (!ndays)
abort()
maxdays = Math.abs(parseInt(ndays));
// source = selectedtab()
tab(tabname)
var items = []
var icount = 0;
var sel = ItemSelection(tabname).selectAll() // selectRemovable()
for (i = sel.length-1; i >= 0; --i) {
if (!plugins.itempinned.isPinned(i)) {
var item = getItem(i)
// we need the preliminary work of 'Store Copy Time' command
if (item[mimestring] != undefined) {
var dtext = str(item[mimestring])
var sdate = new Date(Date.parse(dtext));
var days = (sdate.getTime() - today.getTime()) / msPerDay;
if (days <= maxdays * -1)
{
// just for debugging -> store expired items and list them in a context menu at the end
//var itm = {}
//itm[mimeText] = text // str(days)
//items.push(itm)
// for safety -> you can uncomment the next three lines if this script is working
// with your CopyQ environment, otherwise there will be a copy of your removed items :-)
tab(tabdel)
setItem(i, item)
tab(tabname)
// now remove the expired items
remove(i)
icount ++;
}
}
}
}
if (icount > 0)
popup("Items deleted:", icount, 5 * 1000)
// just for debugging -> store expired items and list them on a context menu
//var i = menuItems(items)
Keine Kommentare:
Kommentar veröffentlichen