Set ATTR META

I am extracting the comments from image files using the usercomment metadata property. It works fine.

The problem comes when I try to write the data back to the image metadata using:

ClickData.Func.Command.AddLine("SetAttr META ""usercomment:" & mynewcomment & """")

mynewcomment is the variable containing the new value I wish to write (I have checked and it does contain the new data). However, for some reason the new data is not written to the image metadata.

Anyone any ideas?

(Obviously I have a command later in the script to run the AddLine commands, of which there are around ten - all of which work except the "usercomment")

I have solved the problem. It seems you have to read the data from "usercomment" and write it back to "comment".
Hardly seems very logical. but it works.

usercomment should probably work in both directions, but without seeing your code that is reading the comment it's hard to say if the problem is the code or if it looks like something is wrong in Opus.

The code I use to read the metadata is

For Each selItem in clickData.func.sourcetab.selected
  Set imageData = selItem.Metadata.image
  Set otherData = selitem.MetaData.other
  mycomments = otherData.usercomment

I then go on with a series of commands to pick up the other meta data

When I try to reverse the code to write the comments back nothing happens. I have to write them back with

	ClickData.Func.Command.AddLine("SetAttr META ""comment:" & mynewcomment & """")

and use the comment field.

It seems odd, but really now I can make it work, I am not in the slightest bothered. Thanks for your observations.

I think there may be a deeper problem with this. I said I was not bothered about the inconsistency displayed here until I started editing images with comments in them in Photoshop CC 2017.

The result of this editing is that any comments disappear when the changes are saved from Photoshop and then looked for in Opus. Restoring the comments in Opus puts things right - until you edit the image again.

Some months ago I reported a similar problem with Photoshop "eating" tags (keywords) and this was fixed by you good people.

I know photo metadata is the largest of dog's breakfasts, but it is essential that you have consistency between you imaging program and you image editing program.

If you want us to look at that, we need before & after versions of an example file, and a list of steps to perform on the file, and what to look for afterwards.

Please forget it Leo. It is nothing to do with Photoshop at all. It is a bad line of code in a macro, which I have now found and fixed.

Still totally baffled why I have to read from usercomment but write to comment.

We'll make "usercomment" work for SetAttr META in the next update (it will be a synonym for "comment").