Jump to content

Convert Disc Image Script


redders
 Share

Recommended Posts

Ok I appreciate I'm asking for real basic help here, but I have no idea where to start. I'm a member of another forum where a talented guy called Nologic created a script which would convert images via demon tools pro to mdf/mds format. The script below is which I speak of -

#include <File.au3>
#include <Array.au3>

; File Extensions to Find
$Find = StringSplit ( 'b5t|b6t|bwt|ccd|cue|isz|mds|nrg|pdi|cdi|iso' , '|' )

; Create Directory Array
$DirList = _FileListToArray ( @ScriptDir & '\' , '*' , 2 )

; Wait for Convert Image Window to Exist
$title = '[CLASS:TConvertImage]'
WinWait ( $title )

For $h = 1 to $DirList[0]
; Create File List Array
    $FileList = _FileListToArray ( @ScriptDir & '\' & $DirList[$h] & '\' , '*' , 1 )

; Test File Extensions in Array Order Against Files
    For $i = 1 to $Find[0]

   ; Test Current Extension Agaist All Files
        For $j = 1 to $FileList[0]
            $ext = StringTrimLeft   ( $FileList[$j] , StringInStr ( $FileList[$j] , '.' , 0 , -1))

       ; If Extension Matched Then Convert Image, Then Test Next Directory
            If $ext = $Find[$i] Then
                WinActivate ( $title )

           ; Set Source File
                $source = @ScriptDir & '\' & $DirList[$h] & '\' & $FileList[$j]
                ControlFocus    ( $title , '' , '[CLASSNN:TTeEdit9]' )
                ControlSend ( $title , '' , '[CLASSNN:TTeEdit9]' , $source , 1 )

           ; Set Destination File
                $destination = @ScriptDir & '\_New_Discs\' & $DirList[$h] & '\'
                DirCreate   ( $destination )
                ControlFocus    ( $title , '' , '[CLASSNN:TTeEdit1]' )
                ControlSend ( $title , '' , '[CLASSNN:TTeEdit1]' , $destination & $DirList[$h] & '.mds' , 1 )
                ControlClick    ( $title , '' , '[CLASSNN:TTeButton4]' )

           ; Wait till complete
                Sleep       ( 2000 )
                WinWait     ( 'Completed - Convert image' )

                ExitLoop 2
            EndIf
        Next
    Next
Next

; End Of File

Now before I had a chance to ask him a question about this code he was banned from the forums.

My question for you guys is, how do I get the converted image to stay in the same folder as its unconverted counterpart? Instead of creating a new folder called '_New_Discs'? I have tried a few things myself, but as I havent a clue what I'm doing I have so far failed.

Thanks in advance.

Link to comment
Share on other sites

  • Developers

My guess would be that something like this should work.

It will replace the extension of the source file with ".mds".

The modified lines:

$destination = @ScriptDir & $DirList[$h] & '\' & StringTrimRight($FileList[$j], StringLen($ext) + 1) & '.mds'
            ; DirCreate($destination)
                ControlFocus($title, '', '[CLASSNN:TTeEdit1]')
                ControlSend($title, '', '[CLASSNN:TTeEdit1]', $destination, 1)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

My guess would be that something like this should work.

It will replace the extension of the source file with ".mds".

The modified lines:

$destination = @ScriptDir & $DirList[$h] & '\' & StringTrimRight($FileList[$j], StringLen($ext) + 1) & '.mds'
        ; DirCreate($destination)
                ControlFocus($title, '', '[CLASSNN:TTeEdit1]')
                ControlSend($title, '', '[CLASSNN:TTeEdit1]', $destination, 1)

Jos

Thanks for the reply. The folder I'm working with have images that are already in mds format. So when I try it with the above amended code it fails because it doesnt expect to find an mds format file.

Any other ideas please?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...