Hi.
I have an external app (Juice, a podcast aggregator). As it completes each download, it does a command line call to my AHK script, passing some variables.
My script uses FFMpeg to convert the files to mpegs (which I play at my tv using a MediaMVP and GB-PVR application).
Its sorta like my little IPTV system.
Problem is.. if I use #singleinstance Off , as each new download completes, it keeps spawning new instances of my script (FFMpeg takes a bit of time). Eventually, the computer bogs down. I cant use #singleinstance Ignore or Force obviously.
My current 'solution' for this, is to only allow one thread at a time for downloading in Juice. That way, once my script is done it closes its own window, then the cmd.exe window (called from the Juice) closes, and the next file downloads.
The drawback is.. it would be nice to be downloading the next file while the current one processes. I just cant figure out how.
Anyone run into a window handling situation like this ?
Code if its needed to looksee..
Code:
#singleinstance off
SetTitleMatchMode, 2
WinMinimize, cmd.exe
TimeStamp = A_Now
FormatTime, TimeStamp,,ddd`,MMMd h:mm:ss
IniRead, Ext, %A_ScriptDir%\mpegmaker4juice.ini, General, Ext
IniRead, FFopt, %A_ScriptDir%\mpegmaker4juice.ini, General, FFopt
IniRead, DelOrig, %A_ScriptDir%\mpegmaker4juice.ini, General, DelOrig
IniRead, FFShow, %A_ScriptDir%\mpegmaker4juice.ini, General, FFShow
;
JuicePathtoFile = %1% ; full path from drive letter to .ext
JuicePodcastName = %2% ; just folder name it seems
;
Splitpath, JuicePathtoFile,,Filedir,FileExt,FilenameNoExt,
If FileExt not in %Ext%
{
Goto, Filetypenotinlist
}
Runwait, ffmpeg.exe -i "%JuicePathtoFile%" %FFopt% "%FileDir%\%FilenameNoExt%.mpeg" ,,%FFShow%
If (DelOrig = "True")
{
FileDelete, %JuicePathtoFile%
}
FileAppend, %TimeStamp% %JuicePathtoFile% converted and deleted (used string %FFOpt%)`n, %A_Scriptdir%\mpegmaker4juice.log
Exit
;
Filetypenotinlist:
Msgbox, 16, mpegmaker4juice, Filetype does not exist in ini file, 8
FileAppend, %JuicePathtoFile% : filetype not in .ini list`n, %A_Scriptdir%\mpegmaker4juice.log
Exit