Archive

Posts Tagged ‘Javascript’

Regex Renamer

August 17th, 2009 Marius No comments

RegexRenamer

This week I set out to make a simple batch application for renaming files. Specifically I wanted to rename folders containing episodes of a TV-show. These files tend to have very ugly names, containing the name of the show, the season and episode, the guy who uploaded it and the file type. I want my collection to contain prettier names, and so I decided to make a batch renamer that could make the folder look more appealing.

I decided to make the application using XUL Runner. XUL Runner is made by Mozilla, and is essentially what Firefox and Thunderbird runs in. It lets you create an GUI using XUL, JavaScript and CSS and then run it as an application. Having made a few extensions to Firefox in my time, XUL was a familiar concept and it didn’t take long until I had a simple working version.

Regex Renamer lets you pick a pattern from a drop down list. It will then look for files that match the regular expression, and renames only those files. This means that if you have a folder where all the files have similar names, then you can rename all of them with a single click. The application also lets you create custom patterns, import and export the list of patterns from/to a file.

It’s not the most user friendly application in the world, and it could do with some work on editing the pattern list, and maybe have a cheatsheet on regex built inn. But for a simple application that took less than a week to code up, it works pretty well.

You can download the application for windows below. It should run on any system that XUL Runner runs on, which would include Windows, Linux and OS X, but you need to download XUL Runner for the last two platforms.

RegexRenamer

Categories: Regex Renamer Tags: , ,

EcmaCalc 0.4

March 25th, 2009 Marius No comments

I have made some updates to EcmaCalc, and it’s reached version 0.4. The new features includes:

  • Abortion of long-running scripts
  • Syntax highlighting (still a bit buggy)
  • Help

There are a few bugs left to sort out, but this version is a lot better than 0.1, so I decided to release it. If you notice any bugs or have any new ideas, post them in the comments.

EcmaCalc 0.4

EcmaCalc 0.1, A better calculator for Windows

August 4th, 2008 Marius No comments
EcmaCalc 0.1

EcmaCalc 0.1

I’ve used the built in windows calculator for years now, but it’s missing some important features. So I made EcmaCalc, which is a pretty stupid, short, name for EcmaScript Calculator. It implements QtScript, which is based on EcmaScript, which is based on JavaScript. That is, you can write JavaScript code in it. This means you can write expressions, functions, loops and create objects and arrays to make your calculations.

For example, you can enter 7*9 and hit the Execute button (or F7) and you will get the answer (in green, on the right). Or you could write something more complicated, like (7+1)*(3-5)/(8+2). You can store the results in variables, just like in JavaScript, like var a = 7+8;var b = 3+2; var c = a * b;.

There’s a lot more you can do, like functions, objects, arrays and loops. There are a few built in things, like the ans variable and the answer and result arrays, which will return the last few results of your expressions. There is also a print function which you can use to print stuff in the middle of loops.

I haven’t written the help yet, because this is an early version. If you find any bugs or have any comments, then please share them.

EcmaCalc 0.1

Marius Gundersen is Digg proof thanks to caching by WP Super Cache