[REQ]Réallocation images en masse

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Pinou
Posts: 4
Joined: 2009-05-12 21:11:38

[REQ]Réallocation images en masse

Post by Pinou »

Bonjour à vous!

J'ai un dossier qui contient toutes mes affiches de film sous forme "titre original.jpg" mais, dans mon catalogue (xml), elles sont renseignées sous forme "titre formaté.jpg"
(ce n'est pas un bug du programme, j'ai simplement importé les images avec l'option titre formaté mais comme je les voulais avec le titre original uniquement... enfin voilà quoi!).

Donc je me demandais si il y avait moyen, via un script par exemple, de changer massivement le chemin relatif des images?
(enfin pas exactement puisque le path est bon, c'est juste le nom du fichier qui ne correspond pas)

Une autre piste que j'ai aussi essayée, c'est d'ouvrir le xml avec un éditeur de texte (notepad++) et de faire un rechercher/remplacer mais ça foire quelque peu...

En clair je suis un peu paumé et j'ai décidé de m'en remettre à vos innombrables talents!

Merci de m'avoir lu et à très vite j'espère :grinking:
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Bonjour,
On ne peut pas contrôler les images par script malheureusement, donc a priori je ne vois pas trop comment faire ça autrement qu'en manipulant le fichier XML...
Pinou
Posts: 4
Joined: 2009-05-12 21:11:38

Post by Pinou »

Aie!

Et bien, je vais tenter de trouver une solution (et je vous tiens au courant! ) :)

Merci quand même
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Well, you could use AMC's scripting engine to manipulate the XML file.. ;)
bonienl
Posts: 156
Joined: 2008-02-24 10:10:43
Location: Netherlands

Post by bonienl »

Malheuresment mon français est três mal, donc je vous écrit en anglais :)

One way to rename all your images is by editing the XML file using a programme called "Editpad Pro". A free evaluation version you can download at http://www.editpadpro.com/download.html.

Once Editpad Pro is installed then press CTRL-F to show the search panel. Within this panel check the 'Regular Expression' option at the right side. This allows to do a search & replace based on expressions.

The following is entered for the search section (copy and paste this):

Code: Select all

<Movie(.+) OriginalTitle=(".+)" FormattedTitle=(".+)" Picture=".+(\.jpg"\/>)
The replace section gets the following:

Code: Select all

<Movie$1 OriginalTitle=$2" FormattedTitle=$3" Picture=$2$4
Do a "Replace All" and you are done! The above expressions will replace the name of the movie file to a file name equal to the original title. I assume your files end on .JPG - if not you must adapt the search string with your extension.

And don't forget to make a copy of your XML file, just in case :o

Bonne chance!
Pinou
Posts: 4
Joined: 2009-05-12 21:11:38

Post by Pinou »

Thank you so much! :grinking: :grinking:

For me, the searching code was:

Code: Select all

<Movie(.+) OriginalTitle=(".+)" TranslatedTitle=(".+)" FormattedTitle=(".+)" Picture=".+(\.jpg"\/>)
And the replacing expression:

Code: Select all

<Movie$1 OriginalTitle=$2" TranslatedTitle=$3" FormattedTitle=$4" Picture=$2$5
After that, I got to reset the path of my pictures, launch amc and smile :D

Great job bonienl!
Post Reply