![]() But I was wondering, is there a way to have only part of the file name placed into each line, on mass?ĪBCD 0123 ABCD AB-CD AB19 0123 AB19 AB19.jpgīasicly a whole mix of alphanumerics some fixed length some not. I was searching for a way to do just this, and found the original Script by John Beardsworth works with changes to the meta line needed. tQualifier(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. I don't have one script that does all three. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |