Sign in to follow this  
Followers 0
MisterMcJohn

Command line scripting with SoX and create a batchfile

4 posts in this topic

first time poster and absolute AutoIt beginner.... please be gentle! I'm trying to write a script to automate the Sox tool to convert a .ul file to .wav en when done delete the .ul file.

But this must be done for a whole disk with directory's. So I like todo this with a script or batchfile.

So what I do now is the following just for one file:

sox -r 8000 -c 1 E:directorydate127call20120629.ul E:directorydate127call20120629.wav

So a script that search into all directory's and convert to /wav en delete when ready the .ul file (don't worry, we have a backup)

The .wav file must be in the some directory as the original file.

 

Share this post


Link to post
Share on other sites



MisterMcJohn,

Welcome to the AutoIt forum. :)

What you want to do is not too difficult.  You can use my RecFileListToArray UDF - look in my sig for the link - to get an array of all the *.ul files on your disk.  You can then use a For...Next loop to work through the array and call your Sox utility using Run for each file, deleting the original using FileDelete once it is converted.

Take a look at the UDF and those functions in the Help file and see if you can come up with something.  You know where we are if you run into trouble and we will be very ready to offer help to get your script running correctly. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Wow... thats a fast reply...

But i'm not a scriptkiddy...hahaha, when looking at your script...no id where to begin?

Share this post


Link to post
Share on other sites

MisterMcJohn,

But i'm not a scriptkiddy

And most certainly neither am I - neither in age nor attitude. :D

A question if I may:  Do you want to learn how to use AutoIt in general, or are you just looking for a script to do this one particular job? :huh:

If the former then reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously.  You should also look at this excellent tutorial - you will find other, more advanced tutorials in the Wiki (the link is at the top of the page).  Then you will get a grasp of the essentials of how to code in AutoIt and what I said above will make more sense and shoudl give you the clues on how to at least start to code something - we will of course be very ready to help refine the result.

If the latter then you need to know right now that we do not write scripts on request from scratch.  Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers.

So which is it to be - a piece of cod and chips or some twine and a needle? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0