Page 1 of 1

[Resolved] Naming films easily with a personalized field

Posted: 2013-10-12 08:13:08
by tdm
Hi !

I'm looking for a way to have a personalized field that could display a string which would be like that : "nameOfTheFilm [year] [directors]" cause I name my movies like that and it's tedious to do it manually.

Any suggestion ?

Thanks,
tdm

Posted: 2013-10-12 10:13:10
by soulsnake
Hi,

There are some differents way to do that.

The simpliest way is to modify HTML template for display to add the string which will be like you want using existing movie fields.

An other simple way is to modify the formatted title in preferences to show formatted title like you want.

An advanced way is to create a virtual custom field and set the template like you do for the formatted title in preferences and add this field in HTML template to show the value (But the value of a virtual custom field is not shown in HTML display for now, this problem will be fixed in next update of AMC 4.2 beta).

A more advanced way is to create a normal custom field and a little script to fill this custom field like you want for all your movies.

What do you prefer ?

Soulsnake.

Posted: 2013-10-12 11:33:42
by tdm
Thanks for answering so quickly !

I tried to modify the formatted title, it works, but i can't copy this string, it's only for display.

I also already tried the virtual field but it doesn't work. However it's a good new that this field will be displayed in the next update.

Can you explain the simpliest way and how to create the script ? I'll try them both and see which one I prefer.

tdm

Posted: 2013-10-12 12:58:36
by soulsnake
I tried to modify the formatted title, it works, but i can't copy this string, it's only for display.
You can copy string if you use HTML display (shortcut F12).
I also already tried the virtual field but it doesn't work. However it's a good new that this field will be displayed in the next update.
The value of a virtual custom field can only be displayed in HTML display (F12), not in default edit mode (the field can not be edited).
Can you explain the simpliest way
- Switch in HTML display (F12)
- Right click in HTML display and click on "edit"
- Modify the template to add your title like you want. For example in HTMLDefaultTemplate, add this code after a "</tr>":

Code: Select all

        <tr>
          <td class="gr">My title:</td>
          <td class="wh">$ITEM_ORIGINALTITLE [$ITEM_YEAR] [$ITEM_DIRECTOR]</td>
        </tr>
- Save the template
- Finish
How to create the script
- Create a custom field of type string with tag = MyTitle
- Open scripting window (Shift+F6)
- Do not select a script (click in empty zone)
- Click on "Editor" (at top left)
- Paste this code:

Code: Select all

program FillMyTitle;
var
  title: string;
begin
  title := GetField(fieldOriginalTitle);
  if GetField(fieldYear) <> '' then
    title := title + ' [' + GetField(fieldYear) + ']';
  if GetField(fieldDirector) <> '' then
    title := title + ' [' + GetField(fieldDirector) + ']';
  SetCustomField('MyTitle', title);
end.
- Click on "Scripts" (at top left)
- Select "All" in movies to include (at right)
- Run the script
- Finish

Note: Replace OriginalTitle by TranslatedTitle if it is what you want.

Soulsnake.

Posted: 2013-10-12 13:31:57
by tdm
I integrated the code you gave for the script into the script I usually use and it works perfectly.
Every time I run the script the custom field is also filled.

Thank you very much for your time.
tdm