![]() |
Chilkat • HOME • Android™ • AutoIt • C • C# • C++ • Chilkat2-Python • CkPython • Classic ASP • DataFlex • Delphi DLL • Go • Java • Node.js • Objective-C • PHP Extension • Perl • PowerBuilder • PowerShell • PureBasic • Ruby • SQL Server • Swift • Tcl • Unicode C • Unicode C++ • VB.NET • VBScript • Visual Basic 6.0 • Visual FoxPro • Xojo Plugin
(AutoIt) XMP Array Property - Bag, Seq, or AltHow to insert or update an XMP array property (bag, seq, or alt).
; This requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oXmp = ObjCreate("Chilkat.Xmp") ; Load a JPG or TIF image file. ; Sample JPG's with XMP metadata may be found at: ; http://www.chilkatsoft.com/testData/xmp/sample1.jpg ; http://www.chilkatsoft.com/testData/xmp/sample2.jpg ; http://www.chilkatsoft.com/testData/xmp/sample3.jpg Local $bSuccess = $oXmp.LoadAppFile("sample1.jpg") If ($bSuccess <> True) Then ConsoleWrite($oXmp.LastErrorText & @CRLF) Exit EndIf ConsoleWrite("Num embedded XMP docs: " & $oXmp.NumEmbedded & @CRLF) ; Assuming there is at least one, get the 1st. ; (There is typically never more than one, but theoretically it's possible.) Local $oXml $oXml = $oXmp.GetEmbedded(0) If ($oXmp.LastMethodSuccess = True) Then ; Create an object to hold one or more string values. $oSa = ObjCreate("Chilkat.StringArray") $bSuccess = $oSa.Append("value_1") $bSuccess = $oSa.Append("value_2") ; ... $bSuccess = $oXmp.AddArray($oXml,"bag","Iptc4xmpCore:Chilkat",$oSa) If ($bSuccess <> True) Then ConsoleWrite($oXmp.LastErrorText & @CRLF) Else ; Save the JPG. $bSuccess = $oXmp.SaveAppFile("modified.jpg") If ($bSuccess <> True) Then ConsoleWrite($oXmp.LastErrorText & @CRLF) EndIf EndIf Else ConsoleWrite($oXmp.LastErrorText & @CRLF) EndIf |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.