Media_RenameItem ( item ; newName )
Media_RenameItem renames a file or folder.
Parameter | Description |
---|---|
item | Path to the item. |
newName | The new name. |
An item cannot be renamed to the same name as an existing item in the same folder.
Examples
To rename a file named “Contacts.fmp12” (in the default folder) to “Contacts 2.fmp12”:
Set Field [ MyTable::Response ;
Media_RenameItem ( "Contacts.fmp12" ;
"Contacts 2.fmp12" ) ]
To rename a file named “Seville1.mp3” on the Desktop to “Sevilla.mp3” while storing any potential error in MyTable::Response:
Set Field [ MyTable::Response ;
Media_RenameItem ( ".D/Seville1.mp3" ;
"Sevilla.mp3" ) ]