I am trying to automate files with renaming and sorting on a per project basis. I was able to get what I wanted essentially, but want to take it a step further. In Automator, I ask for text then set value of Variable and call it “MovieTitle”. Then The next action renames finder items replacing “XXXX” with variable “MovieTitle”
first part of automator actions
Then I have Run Shell Script that makes 4 folders, and then sorts the files into those folders:
`for f in “$@”
do
mkdir -p “/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Amazon”
mkdir -p “/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/iTunes”
mkdir -p “/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Microsoft”
mkdir -p “/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Google Play”
if [[ $f == *"Amazon"* ]]
then
mv $f "/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Amazon"
fi
if [[ $f == *"Google"* ]]
then
mv $f "/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Google Play"
fi
if [[ $f == *"Microsoft"* ]]
then
mv $f "/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/Microsoft"
fi
if [[ $f == *"iTunes"* ]] || [[ $f == *"_#"* ]]
then
mv $f "/Users/kgstudio/Documents/• Designworks •/• VOD Automation •/Kaleidoscope/3. VOD/iTunes"
fi
done`
This actually works and does what I want even though I am sure the code could be refined/ more efficient. My main goal would be to make a parent directory that is the “MovieTitle” variable and have those 4 folders be subfolders of that parent. And also still have the files sort into those specific folders.
I tried a few different things that I read online and even with Chat GPT and nothing seemed to work. For testing, I just added a new line at the start of the script mkdir -p “$MovieTitle”. I tried different variations of this, but a new folder was never added. Just the 4 with absolute paths.
Any help would be appreciated.
Kevin Georgiades is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.