Andrew Guyton's Blog

As a sequel to my previous post, I’ve always wanted to use the metadata embedded in a file (which is usually correct on most downloaded music) to fix the filenames of an arbitrary number of files. Well, I took a little time today and figured it out.

First, I prefer working with context-sensitive methods via Windows Explorer, although there’s no reason you couldn’t build a wrapper that edited the filename of every mp3 on your hard drive. So I look for Windows Explorer, and listen to a keyboard shortcut or extra mouse button press. It loops through the filenames of the items on the clipboard and performs an action on each one.

Read more »

I took it upon myself to root my phone and run a packet capture to figure out why the Android app seemed so slow on my phone. Here is what happens when you start it. All data transfers are in unencrypted JSON unless otherwise noted. I was connected via 4G at the time, and data transfer at the actual convention will likely be much, much slower.

To capture this data, I used shark for root and viewed the resulting data with Wireshark.

Read more »

I’ve gotten back into playing Diablo 2, and I accidentally hit the Windows key every now and then, which minimizes the game. Here’s the code to disable that key via AutoHotkey while Diablo 2 is open and active:

#IfWinActive Diablo II
{
	~LWin Up::Return
	~RWin Up::Return
}

To understand what we’re doing here, you may want to read my introduction to using YQL and Feed43 to create custom RSS feeds. I wanted to pull multiple unconnected elements from a webpage to make an RSS feed, but every example I’d seen recently only used xpath to get one element from the page. The solution to this problem is quite simple; however, the solution evaded me for quite a while. Read more »

A common task I’ve been using AutoHotkey for lately is adding the artist to the filename of an mp3. Here’s some quick code to do that:

RenameSongs(path, artist)
{
	Loop %path%\*.mp3
	{
		IfNotInString A_LoopFileName, %artist%
		{
			newfilename = %artist% - %A_LoopFileName%
			StringReplace newfilename, newfilename, (1),, All
			FileMove %path%\%A_LoopFileName%, %path%\%newfilename%
		}
	}
	TrayTip File rename,Done!
}

Then call it from somewhere else with a path and a proper artist name. How you do that part is up to you, I’m just plugging the values into the script. You could probably make an explorer keyboard shortcut and a box that prompts you for the artist name if you so desired.

Powered by WordPress and theme developed using WordPress Theme Generator.
Copyright © Andrew Guyton. All rights reserved. Feeds: Entries (RSS) and Comments (RSS).