Nueva revision script Alpacine 1.4 a 1.5

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.
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Post by z3us »

Thanks, I will try it later.
Is there any way to change . for , in my existing entries without reimporting from internet?
TY
antp
Site Admin
Posts: 9652
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Post by z3us »

How do I run that???
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

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

Post 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.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

antp wrote:Tools -> scripting, click "new", then "editor", paste the script there.
Tools -> scripting, click "editor", then "new", paste the script there. ;)
antp
Site Admin
Posts: 9652
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

yes, sorry :D
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

Post by z3us »

Lots of Thanks to both of you
z3us
Posts: 86
Joined: 2008-02-19 17:36:53

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

Post by antp »

field is named "fieldMedia" (an error that I made at the beginning, but renaming it later would have broken existing scripts :D)
Post Reply