Re: Terrible! a script has renamed all my movies files ! :(
Posted: 2018-04-27 11:10:25
Grazie ma continua a non crearmi il file 

Official Forum
https://forum.antp.be/phpbb3/
Riprovo e propongo nuovamente lo script (ex-novo), dopo averlo verificato direttamente! Da me funziona, occhio al nome del file .bat, da adattare alle tue esigenze.
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=rename file from catalog
Description=rename File
Site=
Language=IT
Version=1.1
Requires=4.2
Comments=this Script will Rename your movies' file names with informations contained in field File Path (substituting file Name contained in translated title). Obviousely...... be careful!!!
License=GPL
GetInfo=0
RequiresMovies=1
[Options]
[Parameters]
***************************************************)
program RenameFilm;
uses
StringUtils1;
var
MovList: TStringList;
DupList: TStringList;
ResultPath, titlenew: string;
New_filename, old_filename: string;
Giri, giri_fatti, lgth_path: integer;
procedure Elaborazione;
begin
new_filename := getField(fieldFilePath);
old_filename := getField(fieldTranslatedTitle);
Titlenew := 'ren "' + old_filename + '" ' + new_filename + '"';
DupList.Add(Titlenew); //scrivi riga
end;
//
//MAIN PROGRAM
//
begin
if StringUtils1_Version < 3 then
begin
ShowMessage('File "stringutils1.pas" is too old, please download a new version of it');
Error;
end;
if ResultPath = '' then
begin
ResultPath := 'f:\prova\rename.bat.txt';
Input('Update/Aggiorna Films', 'Store results to: / Salva Risultati in: ', ResultPath);
giri := GetiterationCount;
if MovList = nil then
MovList := TStringList.Create;
if DupList = nil then
begin
DupList := TStringList.Create;
end
end;
Elaborazione;
giri_fatti := GetIteration;
if giri_fatti = Giri-1 then //fine elaborazione
begin
Titlenew := 'pause';
DupList.Add(Titlenew); //scrivi riga
DupList.SaveToFile(ResultPath); //chiudi file
end
end.
new_filename := getField(fieldFilePath);otreux wrote: 2018-04-27 17:04:06 il problema credo sia più complicato perché il file .bat tenta di rinominare un file che crede che si chiami "L'altro lato del letto". In realtà il file si chiama "[0277] L'altro lato del letto [El otro lado de la cama] 2002". Quindi non trova il file![]()
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=rename file from catalog
Description=rename File
Site=
Language=IT
Version=1.2
Requires=4.2
Comments=this Script will Rename your movies' file names with informations contained in field File Path (substituting file Name contained in translated title). Obviousely...... be careful!!!
License=GPL
GetInfo=0
RequiresMovies=1
[Options]
[Parameters]
***************************************************)
program RenameFilm;
uses
StringUtils1;
var
MovList: TStringList;
DupList: TStringList;
ResultPath, Titlenew, titolo_originale: string;
New_filename, old_filename, numero_rec, anno_film: string;
Giri, giri_fatti, lgth_path: integer;
procedure Elaborazione;
begin
new_filename := getField(fieldFilePath);
old_filename := getField(fieldTranslatedTitle);
titolo_originale := getField(fieldOriginalTitle);
numero_rec := getfield(fieldNumber);
anno_film := getfield(fieldyear);
if length(numero_rec) = 1 then numero_rec := '000' + numero_rec;
if length(numero_rec) = 2 then numero_rec := '00' + numero_rec;
if length(numero_rec) = 3 then numero_rec := '0' + numero_rec;
Titlenew := 'ren "[' + numero_rec + '] ' + old_filename + ' [' + titolo_originale + '] ' + anno_film + '"';
Titlenew := titlenew + ' "' + new_filename + '"';
DupList.Add(Titlenew); //scrivi riga
end;
//
//MAIN PROGRAM
//
begin
if StringUtils1_Version < 3 then
begin
ShowMessage('File "stringutils1.pas" is too old, please download a new version of it');
Error;
end;
if ResultPath = '' then
begin
ResultPath := 'f:\prova\rename.bat.txt';
Input('Update/Aggiorna Films', 'Store results to: / Salva Risultati in: ', ResultPath);
giri := GetiterationCount;
if MovList = nil then
MovList := TStringList.Create;
if DupList = nil then
begin
DupList := TStringList.Create;
end
end;
Elaborazione;
giri_fatti := GetIteration;
if giri_fatti = Giri-1 then //fine elaborazione
begin
Titlenew := 'pause';
DupList.Add(Titlenew); //scrivi riga
DupList.SaveToFile(ResultPath); //chiudi file
end
end.
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=rename file from catalog
Description=rename File
Site=
Language=IT
Version=1.3
Requires=4.2
Comments=this Script will Rename your movies' file names with informations contained in field File Path (substituting file Name contained in translated title). Obviousely...... be careful!!!
License=GPL
GetInfo=0
RequiresMovies=1
[Options]
[Parameters]
***************************************************)
program RenameFilm;
uses
StringUtils1;
var
MovList: TStringList;
DupList: TStringList;
ResultPath, ext_file, Titlenew, titolo_originale: string;
New_filename, old_filename, numero_rec, anno_film: string;
Giri, giri_fatti, lgth_path: integer;
procedure Elaborazione;
begin
new_filename := getField(fieldFilePath);
lgth_path := length(new_filename);
ext_file := copy(new_filename, (lgth_path - 3), 4);
old_filename := getField(fieldTranslatedTitle);
titolo_originale := getField(fieldOriginalTitle);
numero_rec := getfield(fieldNumber);
anno_film := getfield(fieldyear);
if length(numero_rec) = 1 then numero_rec := '000' + numero_rec;
if length(numero_rec) = 2 then numero_rec := '00' + numero_rec;
if length(numero_rec) = 3 then numero_rec := '0' + numero_rec;
Titlenew := 'ren "[' + numero_rec + '] ' + old_filename + ' [' + titolo_originale + '] ' + anno_film + ext_file + '"';
Titlenew := titlenew + ' "' + new_filename + '"';
DupList.Add(Titlenew); //scrivi riga
end;
//
//MAIN PROGRAM
//
begin
if StringUtils1_Version < 3 then
begin
ShowMessage('File "stringutils1.pas" is too old, please download a new version of it');
Error;
end;
if ResultPath = '' then
begin
ResultPath := 'f:\prova\rename.bat.txt';
Input('Update/Aggiorna Films', 'Store results to: / Salva Risultati in: ', ResultPath);
giri := GetiterationCount;
if MovList = nil then
MovList := TStringList.Create;
if DupList = nil then
begin
DupList := TStringList.Create;
end
end;
Elaborazione;
giri_fatti := GetIteration;
if giri_fatti = Giri-1 then //fine elaborazione
begin
Titlenew := 'pause';
DupList.Add(Titlenew); //scrivi riga
DupList.SaveToFile(ResultPath); //chiudi file
end
end.
Il file .bat è nella stessa cartella del file da rinominare?otreux wrote: 2018-04-28 09:21:34 Non capisco perché ma mi dice ancora "Impossibile trovare il file specificato"![]()
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Fulvio53s03
Title=rename file from catalog
Description=rename File
Site=
Language=IT
Version=1.3
Requires=4.2
Comments=this Script will Rename your movies' file names with informations contained in field File Path (substituting file Name contained in translated title). Obviousely...... be careful!!!
License=GPL
GetInfo=0
RequiresMovies=1
[Options]
[Parameters]
***************************************************)
program RenameFilm;
uses
StringUtils1;
var
MovList: TStringList;
DupList: TStringList;
Indirizzo_cartelle, ResultPath, ext_file, Titlenew, titolo_originale: string;
New_filename, old_filename, numero_rec, anno_film: string;
Giri, giri_fatti, lgth_path, Posbar: integer;
procedure Elaborazione;
begin
new_filename := getField(fieldFilePath);
indirizzo_cartelle := new_filename;
lgth_path := length(new_filename);
ext_file := copy(new_filename, (lgth_path - 3), 4);
old_filename := getField(fieldTranslatedTitle);
titolo_originale := getField(fieldOriginalTitle);
numero_rec := getfield(fieldNumber);
anno_film := getfield(fieldyear);
if length(numero_rec) = 1 then numero_rec := '000' + numero_rec;
if length(numero_rec) = 2 then numero_rec := '00' + numero_rec;
if length(numero_rec) = 3 then numero_rec := '0' + numero_rec;
Posbar := AnsiLastPosEx('\', new_filename, true, true);
if posbar > 0 then
indirizzo_cartelle := copy(indirizzo_cartelle, 1, posbar);
Titlenew := 'move "' + indirizzo_cartelle;
Titlenew := Titlenew + '[' + numero_rec + '] ';
Titlenew := Titlenew + old_filename + ' [' + titolo_originale + '] ' + anno_film + ext_file + '"';
Titlenew := titlenew + ' "' + new_filename + '"';
DupList.Add(Titlenew); //scrivi riga
end;
//
//MAIN PROGRAM
//
begin
if StringUtils1_Version < 3 then
begin
ShowMessage('File "stringutils1.pas" is too old, please download a new version of it');
Error;
end;
if ResultPath = '' then
begin
ResultPath := 'f:\prova\rename.bat.txt';
Input('Update/Aggiorna Films', 'Store results to: / Salva Risultati in: ', ResultPath);
giri := GetiterationCount;
if MovList = nil then
MovList := TStringList.Create;
if DupList = nil then
begin
DupList := TStringList.Create;
end
end;
Elaborazione;
giri_fatti := GetIteration;
if giri_fatti = Giri-1 then //fine elaborazione
begin
Titlenew := 'pause';
DupList.Add(Titlenew); //scrivi riga
DupList.SaveToFile(ResultPath); //chiudi file
end
end.