Page 2 of 2

Posted: 2008-09-13 13:29:29
by z3us
Thanks, I will try it later.
Is there any way to change . for , in my existing entries without reimporting from internet?
TY

Posted: 2008-09-14 10:12:24
by antp
Yes, you can run a small script like this one:

Code: Select all

Program NewScript;
var
  s: string;
begin
  s := GetField(fieldCategory); 
  SetField(fieldCategory, StringReplace(s, ',', '.'));
end.

Posted: 2008-09-14 14:01:08
by z3us
How do I run that???

Posted: 2008-09-14 15:59:01
by bad4u
Use windows editor, notepad or another text editor of your choice that could save files as plain text and copy the text from the the code rectangle into your editor. Save the file as my_script.ifs to your scripts folder and start AMC. Now use "Scripting" from the menu and you will find the new script as "my_script" on the scripts list.

Another way would be to open scripting editor on the scripts list, choose "New" from the menu, copy/paste the code for the new script and save it to a name you like. After closing and reopening the scripting window, the new script should appear on the list.

Take care that you open the scripts list from AMC menu, not using the button "Get information .. from internet", as the new script will not be visible on that list.

Posted: 2008-09-14 18:23:13
by antp
For small scripts like that it is easier to directly paste it in script editor.

So:
Tools -> scripting, click "new", then "editor", paste the script there. You can save it to re-use later, but this is not mandatory: you can run it directly there and discard changes when closing the window.
As bad4u said, such scripts are visible only in "scripting" window, not when called through the "get information from internet" button.

Posted: 2008-09-14 19:54:07
by bad4u
antp wrote:Tools -> scripting, click "new", then "editor", paste the script there.
Tools -> scripting, click "editor", then "new", paste the script there. ;)

Posted: 2008-09-14 20:26:03
by antp
yes, sorry :D

Posted: 2008-09-15 20:54:15
by z3us
Lots of Thanks to both of you

Posted: 2008-09-16 13:04:10
by z3us
Im trying to use it with the "media label" field:

Code: Select all

Program NewScript;
var
  s: string;
begin
  s := GetField(fieldMediaLabel);
  SetField(fieldMediaLabel, StringReplace(s, ',', '.'));
end.
but it gives me a "unknown identifier" error

Posted: 2008-09-16 14:11:49
by antp
field is named "fieldMedia" (an error that I made at the beginning, but renaming it later would have broken existing scripts :D)