wav_to_swa_batch

  vbscript to automatize that "one chunk after another" - swa conversion
SWA WAV d7 wsh




  Wav to SWA conversion
>At 05:51 PM 5/24/00, Al Hospers wrote on Wav to SWA conversion:

>Yea, it's a carry over from the old command line limit of 256 chars or so.
>I still see this symptom in various software. I'm not well enough versed in
>Windows APIs, but I know that some multi-select dialogs get around it and
>some don't. One example of a work-around I've seen is allowing one to
>select a folder rather than all the files in the folder (Premiere, After
>Effects, etc).
>
>


I wrote this vbscript to automatize that "one chunk after another" - swa conversion in d7
Requires windows scripting host 2.0, (get it from ms for free) tested and used on nt4sp3 d7.02 only.
All comments and messages in German, sorry.


'script starts here

' script erlaubt, einen Ordner mit *.wav per DragDrop
' scheibchenweise an director/xtra/convertWavToSwa zu verfuettern
' WSH 2.0, vbScript 5, NT
' @ Daniel Plänitz, erste Version 16.10.99
' v 0.1

set wshshell = CreateObject("WScript.Shell")
set fs = CreateObject("Scripting.FileSystemObject")


' Argumente lesen
set args = WScript.Arguments
if args.Count=0 then
	MsgBox "Dieses Skript ist ein Drag&Drop-Ziel." _
	& " Zieh bitte den Ordner mit den *.wav auf das Skript-Icon!"
	WScript.Quit
end if

if args.Count>1 then
	MsgBox "Kann derzeit nur 1 Dropplet verarbeiten" _
	& " Zieh bitte den Ordner mit den *.wav auf das Skript-Icon!"
	WScript.Quit
end if



' Warnung absenden
MsgBox "Öffne und fernsteuere Director! Während dieser Operation "_
	& "FINGER WEG von TASTATUR und MAUS!"


' director starten:
' Angabe des vollen Pfades nur erforderlich
' auf systemen mit mehreren Installierten director-Versionen.

' watch out for SPACE in the path, they can stop the thing working!
' a possible workaround uses a link to the exe in a path w/o spaces

wshshell.Run "D:\Director7\DIRECTOR.EXE"
wscript.Sleep 6000

' Xtras/Convert und darin Add.. ansteuern

wshshell.SendKeys "%xc"
wscript.Sleep 300

wshshell.SendKeys "{TAB 2}"
wscript.Sleep 300


' so, und jetzt durch die Liste der Dateinamen

set folder = fs.GetFolder(args(0)) 

' Theortisches maximum fuer Anzahl ist 18
' es gibt aber eine Laengenbeschraenkung des Eingabefeldes
' die Konkrete Laenge des Pfadnamens spielt also eine Rolle
Anzahl = 3 '18

x = 0
sermon = ""
for each file in folder.files
  ' sermon = sermon & chr(34) & lcase(file.name) & chr(34) & " "
  sermon = sermon & chr(34) & args(0) & "\" & (file.name) & chr(34) & " "
  x = x + 1
  if x mod Anzahl = 0 then 
     showErg (sermon)
     sermon = ""
  end if
next

if x mod Anzahl > 0 then
 showErg (sermon)
end if

' TAB, RET startet das konvertieren, das Script hat seine Schuldigkeit getan
WshShell.SendKeys "{TAB}"
wscript.Sleep 200

WshShell.SendKeys "~"


' Fertig


' nexte scheibe eingeben
sub showErg(erg)
	WshShell.SendKeys "~"
	wscript.Sleep 100

	WshShell.SendKeys erg
	wscript.Sleep 50

	WshShell.SendKeys "~"
end sub


Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact