[FR/EN] Modifier script IMDb : destination URL

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
Burgerthat
Posts: 14
Joined: 2013-09-15 20:07:01
Location: Nancy, France

[FR/EN] Modifier script IMDb : destination URL

Post 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.
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
Burgerthat
Posts: 14
Joined: 2013-09-15 20:07:01
Location: Nancy, France

Post 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é ?
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post 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.
Burgerthat
Posts: 14
Joined: 2013-09-15 20:07:01
Location: Nancy, France

Post by Burgerthat »

Super ça marche, merci beaucoup !
Post Reply