Page 1 of 1

How can I copy Picture Link to other records

Posted: 2006-11-02 23:59:58
by HappyTalk
I wanted to create a script whereby certain fields (especially) the picture link field for the first selected record would be copied into all the checked records. That way once an image link has been set for first item in a series it can be quickly replicated to all others so they all point to the same cover.

I found 'Duplicate card' in the UpdateFields script that almost does it BUT it doesn't copy the picture link. I can see no variable giving access to this either? The script also copies from the first found (selected/checked/all) record into the following ones.

So how do you gain access to the picture link field? there seems to be no
GetField(fieldPictureFilename)) Yet Picture DOES appear in the 'modifiable fields' check list on the scripts page.

Secondly if there were an additional option when running scripts in the 'Script Limitations' box for selected+checked that ran all the selected records first then the checked ones through the script that would enable me to select record 50 and check record 49 & 51 to be able to copy from a record in the middle to the surrounding ones.

PS - My current workaround is to set the text in the description field (that appears just before the picture field in the xml to picture.jpg at the end, copy to the other fields (copy to dummy record at start if source is after the destinations then onto them). I can now search and replace in the xml file to strip this out of the destination and set up the picture field, but it's a pain.

Posted: 2006-11-03 12:49:45
by antp
Currently the only thing that scripts can do is to use the GetPicture function which download & store picture. There is no other picture handling functions, and the picture name is not accessible through script.

The "additional option" that you suggest is quite specific to your case...

Posted: 2006-11-08 22:04:50
by HappyTalk
OK I saw a post elsewhere where you said you might add access for scripts to the picture link field the same as the other fields.

re additional option I can see that that would not be required if the order with which selected/marked items are processed was the same as the order they are displayed when you run them through a script. I'm not sure what order it uses (id order?).

Having just finished my first script, a rewrite/overhaul of the tv.com script I wrote it to be fully automated caching all info for a series to be re-used if the next item is from the same series. However If I sort all items alphabetically by series name then set it off, it jumps about different series losing this caching advantage and hitting the tv.com servers more than necessary. As it can run through thousands of records with no user intervention it can add a lot of extra work. Can it not run through items in the displayed order based on whatever sort is in operation? It also makes using the copy fields script impossible to use as you dont know which record will be invoked first as the source to copy to the other records.

cheers

Posted: 2006-11-08 23:45:37
by antp
HappyTalk wrote: I'm not sure what order it uses (id order?).
Currently it is somewhat random. I have to fix this bug :D (I do not know yet, either order by ID or let user decide of the order - second solution is better I guess).
HappyTalk wrote:
Can it not run through items in the displayed order based on whatever sort is in operation?
If you group movies on a field (tools -> group by) they may be sorted on that field.
Or if you export movies with a specified sorting order, maybe the order of the internal list will be also kept when processed by the script.
I am not sure, I should check in the code how I did it, but you could try these two things.

Posted: 2006-11-09 08:35:52
by HappyTalk
antp wrote: Currently it is somewhat random. I have to fix this bug :D (I do not know yet, either order by ID or let user decide of the order - second solution is better I guess).
I figured the order they are displayed at in the left hand pane, ie either by number or title, title being a lot more useful than number.
antp wrote: If you group movies on a field (tools -> group by) they may be sorted on that field.
I have been using that option, but it doesn't affect the order of records in batch script. It wouldn't really help to group by that field, not unless they were also secondarily filtered by title.


One last thing I have come across is that being as my script can run fully automated through 1,000's of records, if an error message pops up it halts progress waiting for user input. Is there some way to divert error messages to a logfile or disable them from a script? One example is a timeout error, also if PostPage cannot find the url for some reason. My intention with my script was you select ALL your tv series items, run script, it gets 90% of them(dechecking items it finds), you then re-run on these checked items in a prompt mode where it prompts for series/episode selection. I can send you script for you to see issues in action if you like. I will of course submit it when 100% happy.

Thanks a lot for your help

Posted: 2006-11-09 10:24:37
by antp
Currently there is no error handling for these functions in the script, so timeout/pagenotfound messages cannot be handled properly.
It is also on my to-do list...