Archive for July 28th, 2007

Using VBScript To Automate eBay Turbo Listing HTML Page Editing

Recently asked on Yahoo! Answers:

Help with VB script?

I am new to all this, so please forgive me for talking like a newbie.

I am trying to get into the wonderful world of vbscript to try to help me speed up my listings on Ebay.
[details snipped]

Now as you would imagine all the above takes me several hours to do, and I just thought if I could get my head around a little bit of vbscripting I would save myself one hell of a lot of time. If any kind person out there could point me in the right direction it would be much appreciated.

To summarize what this questioner wants done:

  • He takes about 300 images per night with his digital camera; it somehow orders the photos.
  • He wants to create however many directories are needed to put five photos each into each new directory; each directory should be sequentially numbered based on the last directory he created.
  • He wants to create copies of an HTML template, name it the same as each of the new directories, and change some text in the template to be the same as each folders’ number.

Well, that’s fairly easy to do with VBScript, as he suggests — and it takes VBScript all of about two seconds to do the work.

Since it’s been a cow’s age since I’ve used VBScript to automate something like this, I knew I had to put this script together. It demonstrates some really cool things you can do with shell scripting:

  • Create directories on-the-fly;
  • Move files from one directory to another;
  • Rename files to something else, based on patterns or numeric values;
  • Edit text-based files.

As always, I’ll have the code and sample files available as a download at the end of this post.

Read the rest of this entry »