photools.com Community

BOARD ARCHIVE => IMatch 5 Scripting and Apps => Tips & Tricks and Frequently Asked Questions => Topic started by: ubacher on October 31, 2013, 01:19:00 PM

Title: How to initiate a write-back after changing rating on a file?
Post by: ubacher on October 31, 2013, 01:19:00 PM
I am setting the rating in a script.
How do I initiate a write-back ?
Will this do it:

Code: [Select]
thisimg.Rating = 1

        Dim data As TagData

Set data = thisimg.TagData

data.WriteBack(True)
Title: Re: How to initiate a write-back after changing rating on a file?
Post by: Mario on October 31, 2013, 02:06:06 PM
From the help of the WriteBack method:

(https://www.photools.com/community/index.php?action=dlattach;topic=1248.0;attach=2797;image)



[attachment deleted by admin]
Title: Re: How to initiate a write-back after changing rating on a file?
Post by: Ferdinand on October 31, 2013, 02:36:01 PM
In addition, there are special methods for ratings and labels that greatly simplify the process of updating them in a script.  Details in the help file.  I've posted a script that uses these methods, and I'm sure that there is a sample script that does as well (not currently in front of the main PC)
https://www.photools.com/community/index.php?topic=407.0
Title: Re: How to initiate a write-back after changing rating on a file?
Post by: ubacher on October 31, 2013, 06:34:36 PM
Glad to see that I had figured it out correctly.

Ferdinand: I had looked at your routine but you use database transactions rather than write-backs.

BTW: I have modified your routine for my use to also copy categories and title/subject (no question asked).
Title: Re: How to initiate a write-back after changing rating on a file?
Post by: Ferdinand on October 31, 2013, 10:52:41 PM
I"m on the road and not in a position to look at this, but I think that transactions, if I used them, are not really relevant.  The point is that the special methods for ratings and labels are much simpler to use.  It may be that they don't need write-backs, but I don't recall exactly what it is that's missing from the regular metadata update code.