AutoUpdateIt…

I was updating my AutoIt install just now, and checking the revision history I saw this:

Fixed #3606: CheckForUpdates : Extras\AutoUpdateIt\AutoUpdateIt.au3 script.

And I thought, “Wow, are they still including that update script I wrote a million years ago?”

Yup. :)

A bunch of the code has changed around. People have added new features and updated for new spec, but then there’s some of my old code still intact that should have been updated long ago.
For example, this function should have been replaced with ShellExecute() (which was added in 2013):

Func _Start($s_StartPath)
    Local $s_StartStr
    If @OSType = 'WIN32_NT' Then
        $s_StartStr = @ComSpec & ' /c start "" '
    Else
        $s_StartStr = @ComSpec & ' /c start '
    EndIf
    Run($s_StartStr & $s_StartPath, '', @SW_HIDE)
EndFunc   ;==>_Start

I also found the forum thread where Jon (the creator of AutoIt) originally asked for people to come up with an auto update kind of script. And then I found the actual post where he started including it with the installer, from 2005. Oh it makes a guy feel old. ;)

Posted in General | Leave a comment

YouTube Playlist Mod

A script I wrote for TamperMonkey to add some checkboxes to the YouTube playlist editor for bulk removing items.

// ==UserScript==
// @name         YouTube Playlist Mod
// @namespace    http://tampermonkey.net/
// @version      Rob
// @description  Add checkboxes to playlist editors
// @author       You
// @match        http*://www.youtube.com/playlist*
// @grant        none
// @run-at       document-end
// ==/UserScript==


(function() {
    if (!document.querySelector('.pl-video-edit-remove')) return;

    var mod_controls = document.createElement('div');
    mod_controls.setAttribute('class', 'branded-page-box clearfix');

    var base_button = document.createElement('button');
    base_button.setAttribute('class', 'yt-uix-button yt-uix-button-size-default yt-uix-button-default');
    base_button.setAttribute('style', 'margin-left: 5px;');

    var rem_button = base_button.cloneNode();
    rem_button.innerText = 'Remove Checked';
    rem_button.setAttribute('style', 'background: #faa;');
    rem_button.addEventListener('click', function () {
        if (document.querySelector('.del_chbox:checked') && confirm('Are you sure you want to remove ' + document.querySelectorAll('.del_chbox:checked').length + ' items?')) {
            rem_func();
        }
    });

    var rem_func = function () {
        if (checked = document.querySelector('.del_chbox:checked')) {
            checked.parentNode.parentNode.querySelector('.pl-video-edit-remove').click();

            status_span.innerText = ' Removing items... ' + document.querySelectorAll('.del_chbox:checked').length + ' remaining...';
            status_span.style.opacity = 1;
            setTimeout(rem_func, 1000);
        } else {
        status_span.innerText = ' Complete.';
        status_span.style.opacity = 0;
        }
    };

    var check_all = base_button.cloneNode();
    check_all.innerText = 'Toggle All';
    check_all.addEventListener('click', function () {
        if (document.querySelector('.del_chbox').checked === true) {
            for (let checkbox of document.querySelectorAll('.del_chbox')) {
                checkbox.checked = true;
                checkbox.click();
            }
        } else {
            for (let checkbox of document.querySelectorAll('.del_chbox')) {
                checkbox.checked = false;
                checkbox.click();
            }
        }
    });

    var status_span = document.createElement('span');
    status_span.setAttribute('style', 'opacity: 0; transition: opacity 1s; background: rgba(255, 255, 0, 0.7); padding: 5px; border: dashed 1px #000');

    var channel_box = document.createElement('span');
    channel_box.setAttribute('style', 'position: relative;');

    var case_label = document.createElement('label');
    case_label.setAttribute('style', 'position: absolute; left: 15px; top: 20px; font-size: 0.8em; white-space: nowrap;');

    var case_check = document.createElement('input');
    case_check.setAttribute('type', 'checkbox');
    case_check.setAttribute('style', 'vertical-align: middle;');

    case_label.appendChild(case_check);
    case_label.appendChild(document.createTextNode('Case-sensitive'));

    var check_channel = base_button.cloneNode();
    check_channel.innerText = 'Toggle By Channel';
    check_channel.addEventListener('click', function () {
        var channel_check = prompt('Enter partial or full channel name to select:', '');
        if (!channel_check) return false;
        var count = 0;
        for (let owners of document.querySelectorAll('.pl-video-owner')) {
            if (case_check.checked) {
                if (owners.children[0].innerText.indexOf(channel_check) !== -1) {
                    count++;
                    owners.parentNode.parentNode.querySelector('.del_chbox').click();
                }
            } else {
                if (owners.children[0].innerText.toLowerCase().indexOf(channel_check.toLowerCase()) !== -1) {
                    count++;
                    owners.parentNode.parentNode.querySelector('.del_chbox').click();
                }
            }
        }
        status_span.innerText = ' ' + count + ' items toggled for "' + channel_check + '"';
        status_span.style.opacity = 1;
    });



    channel_box.appendChild(case_label);
    channel_box.appendChild(check_channel);

    mod_controls.appendChild(rem_button);
    mod_controls.appendChild(check_all);
    mod_controls.appendChild(channel_box);
    mod_controls.appendChild(status_span);

    var item_list = document.querySelector('#browse-items-primary');
    item_list.parentNode.insertBefore(mod_controls, item_list);


    var checkbox = document.createElement('input');
    checkbox.setAttribute('type', 'checkbox');
    checkbox.setAttribute('class', 'del_chbox');

    setInterval(function() {
        for (var vid_item of document.querySelectorAll('.pl-video:not(.modified)')) {
            vid_item.classList.add('modified');
            vid_item.classList.remove('yt-uix-tile');
            var checkbox_copy = checkbox.cloneNode(true);
            checkbox_copy.addEventListener('click', function () {
                if (this.checked) {
                    this.parentNode.parentNode.setAttribute('style', 'background: #f88;');
                } else {
                    this.parentNode.parentNode.removeAttribute('style');
                }
            });
            vid_item.children[1].appendChild(checkbox_copy);
            vid_item.children[1].addEventListener('click', function () {
                if (event.target.tagName != 'INPUT') this.children[0].click();
            });
        }
    }, 500);
})();
Posted in TamperMonkey | Tagged , | Leave a comment

ProcRespawn 1.0.0.2

Did some minor upgrades to the program.

  • Update: Using MySingleton.au3
  • Added: Version number to compiled exe
  • Added: Functions for escaping/unescaping ini values to compensate for data with ini sensitive characters (ie: [ ])
  • Added: Add by Path button in the Add Process interface

Download | Source | Icon

Posted in AutoIt | Tagged , | Leave a comment

Floating Clock

A screensaver that displays the time with floating numbers

Download | Source

Continue reading

Posted in AutoIt | Tagged , , | Leave a comment

Notepad++ Forward

A program to “replace” Windows Notepad with Notepad++. Install Notepad++ first, then place Notepad++Forward.exe in the folder with Notepad++.exe and run to install/uninstall. It doesn’t actually replace Notepad, it uses a registry tweak that forwards any calls to Notepad to another program, and then forwards those calls to Notepad++.

Download | Source

Posted in AutoIt | Tagged , | Leave a comment

ProcRespawn

Wrote this program for my brother. He wanted something to run in the background that would make sure certain processes would always be running.

Download | Source | Icon

Posted in AutoIt | Tagged , | Leave a comment

Variable.au3

Functions for dumping variable information.

Download
Continue reading

Posted in AutoIt | Tagged , , | Leave a comment

StickyNotes

My own StickyNotes program because I didn’t like the one that came with Windows.

Download | Source | Icon

Posted in AutoIt | Tagged , | Leave a comment

Magnet Forwarder

This program passes BitTorrent files and magnet links from one computer to another, allowing you to designate one computer as a media server to do all the downloading and storage.

Download | Source | Icon

Posted in AutoIt | Tagged , | Leave a comment

FolderDump

Use this program to pull all the files from subfolders into the parent folder (pass the target folder as a parameter, ie: FolderDump.exe “C:\Downloads\Torrents”).
Download | Source

Posted in AutoIt | Tagged , | Leave a comment