Some new little scripts requested...

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
Guest

Some new little scripts requested...

Post by Guest »

I would like some scripts to make these jobs:

1) Change some or better all fields caps

example: THIS IS THE TITLE >> This it the Title

or something like that

2) Put the actors one for line


I read something about this, but not seen a real script.


Thanks,
Andrea
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

To change the case, put this between the begin/end of a new script :

SetField(fieldOriginalTitle, AnsiUpFirstLetter(AnsiLowerCase(GetField(fieldOriginalTitle))));

And to remplace linebreaks by commas (for examples) :

SetField(fieldActors, StringReplace(GetField(fieldActors), #13#10, ', '));
Andrea

Post by Andrea »

antp wrote:To change the case, put this between the begin/end of a new script :

SetField(fieldOriginalTitle, AnsiUpFirstLetter(AnsiLowerCase(GetField(fieldOriginalTitle))));

And to remplace linebreaks by commas (for examples) :

SetField(fieldActors, StringReplace(GetField(fieldActors), #13#10, ', '));
I did it - the first give me some "violation address" error, the second seems did nothing...

Andre
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

That is really not normal
I tryed both before posting and they were woring :/

You used the function Tools -> Scripting ?
Guest

Post by Guest »

I did it...
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Did you try it on another movie list or when selecting only few movies ?
Guest

Post by Guest »

I need it because I have more than 1000 movies... if it were less, I did manually :)
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I mean, does it happen with all movies or only with some ?
If it is not too big, could you send me your list so I can see if the problem occurs here too ?
(Which version of Windows do you have ?)
frenchfrog_2

Post by frenchfrog_2 »

Hello,
I find out why you got the access violation error, I did some test and you got it when the field is empty, so you have to make sure that the field you want to change is not empty. I modify the script a bit to have the first letter of each words in the fields original title and translated title in caps :

program FindReplaceCaps;

begin
SetField(fieldOriginalTitle, AnsiUpFirstLetter(AnsiLowerCase(GetField(fieldOriginalTitle))));
SetField(fieldOriginalTitle, AnsiMixedCase(GetField(fieldOriginalTitle),' '));
SetField(fieldTranslatedTitle, AnsiUpFirstLetter(AnsiLowerCase(GetField(fieldTranslatedTitle))));
SetField(fieldTranslatedTitle, AnsiMixedCase(GetField(fieldTranslatedTitle),' '));
end.


Hope this help...
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Ok, if it crashes when the string passed to an Ansi... function, it is a bug, I'll try to correct that :o
Post Reply