I have a small VB program that allows me to change the date created and t he date digitized on an image. It works perfectly well 99 per cent of the time. However, when I run the macro against files larger than about 5 megs, I get a message from Windows telling me that the the file is in use.
When I look in the lister I can see my file and also a temp file.
This is something I have seen before when setting large amounts of metadata from a VBscript. It is not life-threatening but it is annoying as you have to keep deleting the temp file before you can try again.
This always happens when the system is under some stress - e g there is an Acronis back-up being taken of the System Drive.
The code I use to set the dates is:
ClickData.Func.Command.AddLine("SetAttr META ""datetaken:" & datery & """") ClickData.Func.Command.AddLine("SetAttr META ""datedigitized:" & datery & """")
where datery is a variable containing the date. This code is followed by a run command.
I surmise is that the first command is executed fine, but when the second command is run the file is flagged by the system is "in use" as the save has not been completed.
An obvious solution is to combine both commands in one SetAttrMeta. My problem is that I cannot work out the syntax for this command. Whatever I try, I keep getting syntax errors.
Could you give me some assistance, please into how such a single command should be parsed?
Yes, I gleaned that from the help files, Leo.
My problem is how do I incorporate that into the VB command that I am running in my macro. That is what is defeating me. Everything I try gives a syntax error. Something to do with numbers of " marks I would guess.
Just remember that in VB, once you're within a "string", a "" inserts a single ". So four " marks in a row ("""") gives you a one character string equal to ".
Sorry Jon, I still just do not get it. As you will have realised, I am no programer .
Could you show me how I should adjust the command line I show above? Presently I am up to my eyeballs in quotation marks and all I get are either syntax errors of t he data is simply not written.