Page 1 of 1

[FR/EN] Modifier script IMDb : destination URL

Posted: 2013-10-01 10:02:49
by Burgerthat
Bonjour à tous !

Tout d'abord merci aux auteurs du script IMDb, c'est un outil vraiment pratique, qui m'économise beaucoup de temps et me permet de faire de nouvelles choses.

Je souhaite modifier le script afin d'envoyer l'URL de la page du film vers un champ personnalisé, "URLWeb".
(Le but est de pouvoir lancer un film avec le raccourci Ctrl+M, tout en gardant la page IMDb à portée de main ; donc je libère le champ "URL", et après j'importerai dedans le chemin du fichier vidéo.)

Donc j'ai benoîtement essayé avec le mode éditeur de remplacer tous les "fieldURL" par "fieldURLWeb", puis d'enregistrer ce script modifié à part. Quand je l'ai testé, le processus a planté en pointant la première occurrence de mon "fieldURLWeb".

Des idées ? :) Merci pour votre aide.


===

Hi everyone!

First, thanks to the authors of the IMDb script, which is very useful to me: it allows me to gain time while doing things I couldn't do before.

I'm trying to modify the script in order to direct the URL of the page to a custom field, "URLWeb", instead of the default field "URL". (In the end, I'd like to be able to launch a film right from AMC with a Ctrl+M shortcut, while keeping the IMDb page at hand. So I empty the URL field, and will import in it the path to video file.)

So, dummy as I am, I tried to edit the script to replace all "fieldURL" with "fieldURLWeb". I saved this script aside from the original one, and tested it: the process crashed and showed the exact first line where I had written "field URLWeb".

Any ideas? :) Thx for your help.

Posted: 2013-10-01 11:08:18
by antp
Bonjour,
Il faut utiliser SetCustomField au lieu de SetField, et passer le nom du champ personnalisé comme chaîne (entre '...') vu qu'il n'est pas défini comme constante contrairement aux champs de base.

--

Hi,
You have to use SetCustomField instead of SetField, and pass the custom field name as string (between '...') since it is not defined as constant, unlike basic fields.

Posted: 2013-10-01 16:14:57
by Burgerthat
Alors j'ai remplacé :
- tous les "fieldURLWeb" par "field'URLWeb'"
- "SetField" par "SetCustomField" (quand il était suivi de field'URLWeb')

--> "Erreur de script dans "IMDb" : unknown identifier: FIELD à la ligne 150"

Cette ligne 150, la voici :

Code: Select all

if CanSetField(field'URLWeb') then
J'ai essayé de remplacer "CanSetField" par "CanSetCustomField", ça plante au même endroit. Est-ce que je dois modifier l'expression "field'URLWeb'" ? Il y a aussi un "GetField(field'URLWeb')" à la ligne 1030, devrait-il être aussi modifié ?

Posted: 2013-10-01 17:02:08
by soulsnake
Il faut écrite le code comme ceci :

Code: Select all

 - CanSetCustomField('URLWeb')
 - SetCustomField('URLWeb', VALUE)
 - GetCustomField('URLWeb')
Pas besoins du mot field ;)

Soulsnake.

Posted: 2013-10-02 16:31:55
by Burgerthat
Super ça marche, merci beaucoup !