Set MetaData of Movie |
Sets metadata of a movie file. Metadata can contain a title, description of the movie and so on.
Syntax
Set MetaData of Movie [ Select ; Result (error) ; Source filePath ;
Destination filePath ; Action ; Metadata ]
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 Title/Description/Creation Date/GPS Location or Set with XML |
Metadata | metadata text or XML |
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 |
$$-50 | paramErr | parameter error |
Other errors may be returned.
Originated in
Troi File Plug-in 11.0
Compatibility
FileMaker Pro 17 to FileMaker Pro 21 (2024)
Considerations
See the example file SetMovieMetadata.fmp12 for detailed information on how to set or change the metadata of a movie.
If the destination filePath 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.
If you specify the action “Set with XML” you can set several types of metadata at once, which will be faster, especially with large movie files.
Example
Set MetaData of Movie [ $ErrorCode ;
"MacHD:Users:you:myData:source.mov" ;
"MacHD:Users:you:myData:new.mov" ; Action: Set Title ; "My Blockbuster" ]
This will set the movie title to “My Blockbuster”. All other metadata will stay the same.
Example 2
If you specify the action “Set with XML” you can set (or change) several types of metadata at once.
We assume that in your FileMaker file the following field is defined:
gMovieMetaDataXML Global, text
gMovieMetaDataXML should contain XML, something similar to this below:
<metadata>
<title>My Blockbuster 2</title>
<description>A great movie about FileMaker blocks.</description>
<keywords>block; fileMaker; devcon</keywords>
<creationdate>2019-05-14T15:12:34+0100</creationdate>
<gpslocation>37.406368 -121.983482 +123.0</gpslocation>
<comment>great script!</comment>
</metadata>
In a script add the following steps:
Set Variable [ $Path ; "path to the source movie here" ]
Set Variable [ $NewPath ; "path to the destination here" ]
Set Variable [ $MovieMetaDataXML ; gMovieMetaDataXML ]
Set MetaData of Movie [ $ErrorCode ; $Path ; $NewPath ; Set with XML ; $MovieMetaDataXML ]
This will set the metadata of the new movie as specified by the XML.
Example 3
If you want remove a few items of metadata you can set those values to nothing in the XML. For example to remove the title and description metadata use the Set With XML option and the steps of example 2 with the following XML:
<metadata>
<title></title>
<description></description>
</metadata>
All other metadata will remain unchanged.
Related script step
Set MetaData of Image File |
Related functions
TrFile_GetMetaData |
TrFile_SetMetaData |
TrFile_SetMovieMetaData |
Related topics
Troi File Plug-in online help (overview)