Jump to content

_FF_DM.au3 error


dickep
 Share

Recommended Posts

I love this utility but.... I can't get this to work. So, I modified Stilgar's example but can't get it to work right.

Here is the code:

#Region Includes
#include <Array.au3>
#include <_FF_DM.au3>
#EndRegion Includes

If _FFConnect() Then
    If _FF_DM_IsDownloading() Then
        ; IDs of the current downloads
        $aIDs = _FF_DM_GetActiveDownloadsIDs()
        _ArrayDisplay($aIDs,"IDs only")

        If UBound($aIDs) > 1 Then
            ; Informations about the first download
            for $x = 0 to ubound($aIDs)
                $aInfo = _FF_DM_GetDownloadInfo($aIDs[$x])
                _ArrayDisplay($aInfo,"Info")
            next
            ; Pausing the first download
            _FF_DM_DownloadPause($aIDs[1])
            If _FF_DM_GetDownloadState($aIDs[1]) = 4 Then MsgBox(64,"Download paused:",$aInfo[6])
            sleep(5000)

            ; Resume the first download
            _FF_DM_DownloadResume($aIDs[1])
            If _FF_DM_GetDownloadState($aIDs[1]) = 0 Then MsgBox(64,"Download is active:",$aInfo[6])
        EndIf
    EndIf
EndIf

Exit

What I am trying to do is see the file it generates so I can see if maybe, just maybe, I can keep from downloading duplicates.

==============================================================================

Here is the console output that I found and in it has the error:

__FFRecv: [xpconnect wrapped nsIDownload] — {QueryInterface: function() {…}, state: 0, speed: 20000.382582503422, size: 195000000, amountTransferred: 236676, onStateChange: function() {…}, onprogressChange: function() {…}, ...}

__FFSend: try{FFau3.tmp="";FFau3.tmp+=FFau3.obj.targetFile.target+"|";FFau3.tmp+=FFau3.obj.percentComplete+"|";FFau3.tmp+=FFau3.obj.amountTransferred+"|";FFau3.tmp+=FFau3.obj.size+"|";FFau3.tmp+=FFau3.obj.source.spec+"|";FFau3.tmp+=FFau3.obj.displayName+"|";FFau3.tmp+=FFau3.obj.startTime+"|";FFau3.tmp+=FFau3.obj.speed+"|";FFau3.tmp+=FFau3.obj.MIMEInfo.MIMEType+"|";FFau3.tmp+=FFau3.obj.id+"|";FFau3.tmp+=FFau3.obj.state+"|";FFau3.tmp+=FFau3.obj.referrer.spec+"\n";FFau3.tmp;}catch(e){'_FFCmd_Err';};

__FFRecv: _FFCmd_Err

__FFSend: try{FFau3.obj = Components.classes["@mozilla.org/download-manager;1"].getService(Components.interfaces.nsIDownloadManager).getDownload(0);}catch(e){-3;};

__FFRecv: -3

C:\Documents and Settings\GD8K01\My Documents\FF_DM_Test1.au3 (15) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$aInfo = _FF_DM_GetDownloadInfo($aIDs[$x])

$aInfo = _FF_DM_GetDownloadInfo(^ ERROR

->19:57:53 AutoIT3.exe ended.rc:1

=====================================================================================

Thanks and I probably just have the coding incorrect.

E

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...