Hello
I was trying to make the same script as you (that's the way I found this post), but now I found yours already made. Btw, I think that it could be a good idea giving the option to save the image with the date and time so you don't need to count, something like:
<<name-ddmmyy-hhmm.png>>
...or something like that. Maybe someone likes to see as much information as possible in the file name and maybe somebody else prefers to put a name manually each time... In my case I decided to use this:
<<email@[without"hotmail".com]yymmddhhmm>> so when I sort my images by name, they are also sorted by owner, date and time. To add this option to the script you could use something like your: "/dpsetnick <name>" with a little difference to make it recognize some parameters: "date", "time", "mail", "nick"(that can be changed with the other command), "counter"...
Then, the file name to use could be selected with that command:
"/comm_to_change_filenames mail+date+time"
or
"/comm_to_change_filenames nick+counter"
so the result in the first case is similar to what I like and in the second is totally different.
It's only an idea, I don't want to be annoying or rush you to add options
I was trying out your script while writing this and I couldn't make it work... Debugger gave me an error in line 80 ("file.Copy(savePath + saveFile);") so I erased that and included a part of my own code in its place:
code:
var fecha = new Date();
var horas = fecha.getHours();
if (horas < 10) {horas = "0" + horas;}
var minutos = fecha.getMinutes();
if (minutos < 10) {minutos = "0" + minutos;}
var segundos = fecha.getSeconds();
if (segundos < 10) {segundos = "0" + segundos;}
var dia = fecha.getDate();
if (dia < 10) {dia = "0" + dia;}
var mes = fecha.getMonth();
if (mes < 10) {mes = "0" + mes;}
var direccion = contact.Email;
var nombre = "";
for (i=0;direccion.charAt!="@";i++)
{
nombre = nombre + direccion.charAt;
}
nombre = nombre + "@";
file.Copy(savePath + nombre + fecha.getYear() + "-" + mes + "-" + dia + "_" + horas + "-" + minutos + "-" + segundos + ".png");
It's not too well done yet, but the script is working alright for me now. Was it only me who had the problem??? Anyway, this is what I meant before about naming files.
C U
EDIT: excuse me, I think it's clear but the light bulb is "( i )" (without spaces) and most of the variables are named in Spanish, but I hope everybody understands it... if not, feel free to ask
EDIT2: some errors fixed on the code