3/4/2023 0 Comments Exiftool commandtQualifier(XMPConst.NS_DC, "title", "", "lang", "x-default") MyXmp.appendArrayItem(XMPConst.NS_DC, "title", Title, 0, XMPConst.ALIAS_TO_ALT_TEXT) tQualifier(XMPConst.NS_DC, "description", "", "lang", "x-default") MyXmp.appendArrayItem(XMPConst.NS_DC, "description", Desc, 0, XMPConst.ALIAS_TO_ALT_TEXT) leteProperty(XMPConst.NS_DC, "description") Title.push(myXmp.getArrayItem(XMPConst.NS_DC, "title", i)) Var titleCount = untArrayItems(XMPConst.NS_DC, "title") ĭesc.push(myXmp.getArrayItem(XMPConst.NS_DC, "description", i)) Var descCount = untArrayItems(XMPConst.NS_DC, "description") Var myXmpFile = new XMPFile(selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE) Var FileName = decodeURI(selectedFile.name).replace(/\. $/, '') * Original script modified by Stephen Marsh - 2021įT = MenuElement.create("command", "Add Filename to Description and Title", "at the end of Tools") I have adjusted an existing script for Description to also include the Title: It turns out that I didn't have a script that writes the filename to both the Description and Title metadata fields. Var selectedFile = new Thumbnail(thumbs) I posted the following code earlier in the topic thread, which adds the file name to the description field, removing the filename extension. MyXmpFile.closeFile(XMPConst.CLOSE_UPDATE_SAFELY) Īfter running all three scripts, I used ExifTool to confirm which metadata tags were written:Īnd here is the result from Bridge's Metadata panel for a file titled "colour FILE-Test.psd": MyXmp.appendArrayItem(XMPConst.NS_DC, "title", Title, 0, Var myXmpFile = new XMPFile( selectedFile.fsName, XMPConst.UNKNOWN, Var Title = decodeURI(selectedFile.name).replace(/\. $/, '') If (ExternalObject.AdobeXMPScript = undefined) ExternalObject.AdobeXMPScript = new Var items = xmp.countArrayItems(ns, prop) ĪrrItem.push(xmp.getArrayItem(ns, prop, i)) įT = MenuElement.create("command", "Add FileName to Title", "at the end of Tools") tadata = new Metadata(newPacket) ĮxternalObject.AdobeXMPScript = undefined Var newPacket = xmp.serialize(XMPConst.SERIALIZE_USE_COMPACT_FORMAT) Xmp.setLocalizedText( XMPConst.NS_DC, "description", null, "x-default", Desc = decodeURI().replace(/\. $/,"")) Xmp.deleteProperty(XMPConst.NS_DC, "description") Var Desc = getArrayItems(XMPConst.NS_DC, "description") ![]() Var selectedFile = new Thumbnail(thumbs ) If (ExternalObject.AdobeXMPScript = undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript") Here is the code for Filename to Description:įileToDesc = MenuElement.create("command", "Add FileName to Description", "at the end of Tools") Var menu = MenuElement.create( "command", "Add filename to Credit", "at the end of Tools") Bridge script to write filename to Description, Credit Line, andTitle lines I did manage to hack an existing script to add the Filename to the Headline into the Credit: ![]() I could possibly combine them with time/effort, but no promises as I'm new to scripting. ![]() If you're using PowerShell, I believe you need to swap the double quotes for single quotes to prevent PS from assuming the dollar sign is the start of a variable.I don't have one script that does all three. The quoting for this command assumes you're using CMD. In this case, any additional copies will have an UnderscoreNumber added to the filename.Įxiftool -d "%Y:%m:%d %H:%M:%S" -r -if "$FileModifyDate gt $DateTimeOriginal" -Filename=/path/to/modified/%f% c.%e /path/to/source ![]() If you need to deal with filename collisions, you can add a copy number to any additional files by switching from -Directory to -Filename and adding some percent tokens which are detailed in the -w ( -TextOut) option. 2021:03:26 12:00:00, and that would cause FileModifyDate to be greater than DateTimeOriginal if the time stamps were otherwise identical. The -d ( -dateFormat) option is needed because the FileModifyDate will always include the time zone of the computer, e.g. If so, it will move it to /path/to/modified/ This checks the FileModifyDate to see if it is greater than (string comparison) the DateTimeOriginal. Exiftool -d "%Y:%m:%d %H:%M:%S" -r -if "$FileModifyDate gt $DateTimeOriginal" -directory=/path/to/modified/ /path/to/source
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |