Posts

Post not yet marked as solved
2 Replies
747 Views
I am a recent convert to the Mac ecosystem, I have a windows batch script from when I was using windows that i would like to adapt to an automator script. It is pretty simple. The goal of is about using ffmpeg to convert media files to the proper WAV format for a sampler I have. Essentially what it does is allow you to right click on a file in a folder, and the script looks through all media files in that folder, then creates a new folder in an exports folder, and converts all the files to 44.1 khz wav files and places them in the few folder. An additional wrinkle of my original script that isn't completely necessary is that it queries you about whether you want to use the original folder name or create a new one. I wonder if y'all can provide me some guidance for adapting this to a bash script for automator. I am pretty new to bash scripts and not exactly an A+ programmer. I already have simple bash scripts working, doing things like creating a directory or other simple terminal like commands, but I haven't quite figured out things like setting variables or getting user input from a pop up terminal. Thanks for any help you could provide! @ECHO OFF for %%I in (.) do set CurrDirName=%%~nxI set CurrDir="%CD%" cd C:\Users\warpi\Desktop\Samples\Octatrack Exports set /p name= Use Parent Folder Name? [Y/N]: if %name%==y (set input=%CurrDirName%) else (set /p input= Folder Name: ) mkdir "%input%" echo Directory Created: "%input%" cd %CurrDir% for %%i in (*.*) do ffmpeg -i "%%i" -ar 44100 "C:\Users\warpi\Desktop\Samples\Octatrack Exports\%input%\%%~ni.wav" ::for %%i in (*.wav) do ffmpeg -i "%%i" -ar 44100 "C:\Users\warpi\Desktop\Samples\Octatrack Exports\%input%\%%~ni.wav" PAUSE
Posted Last updated
.