Skip to main content

Set MetaData of Image File (script step reference)

By June 1, 2024June 4th, 2024Online Help, Troi File Plug-in
Troi File Plug-in > Script steps reference > Set MetaData of Image File
Troi File Plug-in for FileMaker Pro

Set MetaData of Image File

Sets metadata into an image file. Metadata can contain a description of the image, copyright information, etc.

SyntaxScript step badge

Set MetaData of Image File [ Select ; Result (error) ; Source filePath ;
                             Destination filePath ; Action ;
                             Metadata block ; Encoding ]

Options

Select entire contents replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result (error) an error code
Source filePath the path to the source file
Destination filePath (optional) the path to the destination file
Action Set Exif/Set IPTC
MetaDataBlock text formatted for this function
Encoding the desired character encoding like UTF-8

Returned Result

Data type returned

Error code

Result

The returned result is an error code. Returned error codes can be:

0 no error the metadata was set
$$-43 fnfErr Source file not found

Other errors may be returned.

Originated in

Troi File Plug-in 9.0

Compatibility

FileMaker Pro 17 to FileMaker Pro 21 (2024)

Considerations

If the destination parameter is empty the metadata will be saved in the source file itself. This happens also when you specify the same source file and destination file.
Currently only works with JPEGs.
ISSUES: Photoshop (or other programs) may have added other types of metadata, like XMP. These types of metadata are not changed at the moment. This may cause inconsistent metadata in the file.

If you want to remove IPTC data set the metaDataBlock to “”.

See the example files “IPTC_XMP_Metadata” for information on how to create the metadata block.

Example

Set MetaData of Image File [ Select ; gErrorCode ; "C:\myData\Photo1.jpg" ; 
			      Action: Set IPTC ; "##IPTC 120¶ my caption ¶##END 120" ]

This will set the IPTC data, in this case only a caption. Note the returns in the IPTC data.

Example 2

Set MetaData of Image File [ Select ; gErrorCode ;  
			       this::PathToSourceFile ; this::PathToDestinationFile ; 
			       this::gMetaDataBlock ; Encoding: UTF-8 ]

gMetaDataBlock should contain something similar to this below:

##IPTC 120
FOR IMMEDIATE RELEASE–FILE–Shania Twain performs at the Country Music Association Awards show in Nashville, Tenn., …
##END 120
##IPTC 122
CJC RWP MAH
##END 122
##IPTC 105
SHANIA TWAIN
##END 105
##IPTC 40
FOR IMMEDIATE RELEASE. A SEPT. 22, 1999 FILE PHOTO. DIGITAL IMAGE
##END 40

Related script stepScript step badge

Set MetaData of Movie

Related functionsFunction badge

TrFile_GetMetaData
TrFile_SetMetaData

Related topics

Troi File Plug-in online help (overview)


Online Help Page for Troi File Plug-in for 17 to 2024 –> Set MetaData of Image File (filep7287) 2024-0604 19:14:14