TrFile_SetMovieMetaData |
Sets metadata of a movie file. Metadata can contain a title, description of the movie and so on.
Syntax
SetMovieMetaData ( switches ; sourceFilePath ; destFilePath ; metadata )
Parameters
switches | these determine the metadata that is set |
sourceFilePath | the path to the source file |
destFilePath | (optional) the path to the destination file |
metadata | the metadata you want to set or change |
Switches
switches can be one or more of the following:
-SetTitle | set the title in the metadata of the movie |
-SetDescription | set the description of the movie |
-SetCreationDate | set the creation date in the metadata of the movie |
-SetGPS | set the GPS location of the movie |
-SetWithXML | set all metadata with (simple) 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 use the switch “-SetWithXML” you can set several types of metadata at once, which will be faster, especially with large movie files.
Example
Set Variable [ $ErrorCode ; TrFile_SetMovieMetaData ( "-SetTitle" ;
"MacHD:Users:you:myData:source.mov" ;
"MacHD:Users:you:myData:new.mov" ; "My Blockbuster" ) ]
This will set the movie title to “My Blockbuster”. All other metadata will stay the same.
Example 2
If you use the switch “-SetWithXML” 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 Variable [ $ErrorCode ; TrFile_SetMovieMetaData ( "-SetWithXML" ;
$Path ; $NewPath ; $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 -SetWithXML switch and the steps of example 2 with the following XML:
<metadata>
<title></title>
<description></description>
</metadata>
All other metadata will remain unchanged.
Used in example file
SetMovieMetaData.fmp12
Related functions
TrFile_GetMetaData |
TrFile_SetMetaData |
Related script steps
Set MetaData of Image File |
Set MetaData of Movie |
Related topics
Troi File Plug-in online help (overview)