Jump to content
Sign in to follow this  


Recommended Posts

I like to use FAVC video converter, but I don't like to use that Folder Pick thing built into

Windows to select the DVD Output Folder. I made this hack to change the output folder

setting, then launch FAVC.exe.

I had some time to kill today I guess :)

(Edit with hopefully debugged final version of script)

#cs ----------------------------------------------------------------------------

 AutoIt Version:
 FavcDest - Makes it easier to select FAVC video converter destination folder
 Author:    MilesAhead
 Date:      2/Mar/2008

 Script Function:
    Compile this script and put a shortcut to it in the SendTo Folder
    so that you can right click a Folder for FAVC output.  Since FAVC
    has that Folder Picklist and doesn't allow any other method to
    choose the output folder other than manually editing the batch files,
    I made this hack to modify the FAVC Config.ini file before launching FAVC.
   Right click a Folder you wish to use as the destination for a FAVC
   video conversion and select FavcDest from the Send To list. On first
   run a FileOpenDialog lets you select FAVC.exe so that FavcDest may store
   its location in an .ini file.  Then it launches FAVC.exe with this
   Folder as the "Destination DVD Folder."
   Alternatively, if FavcDest.exe is in the path you can invoke it from
   the command line with the destination folder as param.

   (Unfortunately you still have to load the media and subtitle files manually.)

   The FAVC Config.ini file is overwritten on each run.  If it gets hosed,
   just delete it.  FAVC will create it again when you change settings.
   The location of the .ini file is FavcInstallFolder\Documents\Config.ini
   Creates an .ini file named FavcDest.ini in the folder where FavcDest.Exe
   is located.
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <File.au3>
Dim $fArray
$destDir = $CmdLine[1]
If Not FileExists($destDir) Then
    MsgBox(0,"FavcDest", $destDir & " Does Not Exist",4)

$favcFolder = "Unknown"
If Not _Init_Folder($favcFolder) Then
    MsgBox(0,"FavcDest", "Location of FAVC.exe Unknown",4)

$inFile = $favcFolder & "\Documents\Config.ini"

; used 2 filename vars to set a different output file during debugging
$outFile = $inFile

; first check if FAVC created Config.ini
If Not FileExists($inFile) Then
    MsgBox(0,"FavcDest", $inFile & " not found: run a FAVC conversion to create it")
    ShellExecute($favcFolder & "\FAVC.exe","",$favcFolder)

; FAVC will not use Config.ini if it finds an end-of-line on
; the last line of the file.  That's why the loop stops one line
; short and the last line is written without an end-of-line.

If _FileReadToArray($inFile, $fArray) Then
    $handle = FileOpen($outFile, 2)
    $fArray[1] = $destDir
    For $i = 1 to $fArray[0] - 1
        FileWriteLine($handle, $fArray[$i])
    FileWrite($handle, $fArray[$fArray[0]])
    ShellExecute($favcFolder & "\FAVC.exe","",$favcFolder)

Func _Init_Folder(ByRef $favcInstallFolder)
    $iFile = @ScriptDir & "\FavcDest.ini"
    $fname = IniRead($iFile, "FavcFolder", "FAVC", "NotFound")
    If $fname <> "NotFound" Then
        $favcInstallFolder = $fname
        Return True
    $fname = FileOpenDialog("Select FAVC exe File", @ProgramFilesDir,"Executables (*.exe)",1 + 2,"FAVC.exe")
    If @error Then
        Return False
    IniWrite($iFile,"FavcFolder","FAVC", @WorkingDir)
    $favcInstallFolder = @WorkingDir
    Return True
Edited by MilesAhead

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...