This repository contains a collection of useful scripts for various tasks. Each script is designed to perform a specific function and can be easily executed from the command line.
This script allows for batch renaming of files in a directory by changing their file extensions. It supports case-insensitive matching of file extensions.
To use the batch_rename_ext.sh
script, follow these instructions:
-
Clone the Repository:
git clone [email protected]:cccr/scripts.git cd scripts
-
Make the Script Executable:
chmod +x batch_rename_ext.sh
-
Run the Script:
To rename all .m4v files to .mov files:
./batch_rename_ext.sh m4v mov
• Case-insensitive renaming.
• Reports each file it renames.
• Provides feedback if no files are found with the given extension.
A script that extracts the CreateDate
EXIF tag from video files (supports .m4v
and .M4V
formats) and sets the file's creation date accordingly. It can process individual files or all files in the current directory.
The set_creation_date_from_exif.sh
script was created after I realized that movies downloaded from iCloud have incorrect creation dates, making it difficult to import them into tools like Lightroom.
To use the set_creation_date_from_exif.sh
script, follow these instructions:
-
Clone the Repository:
git clone [email protected]:cccr/scripts.git cd scripts
-
Make the Script Executable:
chmod +x set_creation_date_from_exif.sh
-
Run the Script:
- To process all .m4v and .mov files in the current directory:
./set_creation_date_from_exif.sh .
- To process a specific file:
./set_creation_date_from_exif.sh <filename>.m4v
-
Verify Metadata: After running the script, you can verify the metadata with the following command:
exiftool -a -G1 -s -n -api QuickTimeUTC=1 -FileCreateDate -FileModifyDate -CreateDate -GPSCoordinates -DateTimeOriginal -CreationDate .
The script is designed to handle video files with the following extensions:
# List of acceptable extensions (case insensitive)
ACCEPTABLE_EXTENSIONS=("m4v" "mov")
This means the script will accept both lowercase and uppercase variations of these extensions, allowing for flexibility when processing files.
ExifTool: This script requires ExifTool to extract EXIF metadata. You can install it via Homebrew:
brew install exiftool
Contributions are welcome! If you have any scripts or improvements, feel free to submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.