Author Topic: How to initiate a write-back after changing rating on a file?  (Read 2856 times)

ubacher

  • Oldtimer
  • ****
  • Posts: 2358
How to initiate a write-back after changing rating on a file?
« 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)

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 29760
Re: How to initiate a write-back after changing rating on a file?
« Reply #1 on: October 31, 2013, 02:06:06 PM »
From the help of the WriteBack method:





[attachment deleted by admin]

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Re: How to initiate a write-back after changing rating on a file?
« Reply #2 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

ubacher

  • Oldtimer
  • ****
  • Posts: 2358
Re: How to initiate a write-back after changing rating on a file?
« Reply #3 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).

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Re: How to initiate a write-back after changing rating on a file?
« Reply #4 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.