based on nime5ter reply in this topic
http://voxcommando.com/forum/index.php?topic=1833.msg15942#msg15942here is a command that can be used to download files ... it needs python plugin ... and takes four payloads
{1} Path, where file to be saved
{2} File name
{3} URL to download from
{4} Overwrite if file exists
Features:
- stores download history in map, there is a command you need enable it to create the map or create it manually.
- since I use VC on 2 machine as well I store which machine downloaded the file. if you are using version older than 2.216 see
http://voxcommando.com/forum/index.php?topic=2507.0 use 2.216 new command System.GetVar MachineName and store it in a variable ... or you can skip this, just remove the {Var.MachineName} from the map.set
- check if the file exist before downloading it, if overwrite is false it won't download the file - kind of green / bandwidth / possible money saver feature
if you find bugs, or enhancement post a reply ...
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.6-->
<command id="297" name="File Downloader" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} Path
{2} File name
{3} URL
{4} Overwrite">
<action>
<cmdType>Map.CreateTable</cmdType>
<params>
<param>DownloadHistory</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>File.Read</cmdType>
<params>
<param>{1}\{2}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>LastActionSuccess</ifType>
<ifParams>&&</ifParams>
<then>
<action>
<cmdType>VcAdvanced.Log</cmdType>
<params>
<param>{1}\{2} already exist</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>Map.Set</cmdType>
<params>
<param>DownloadHistory</param>
<param>FileOverwrite</param>
<param>True</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)Contains(B)</ifType>
<ifParams>{M:DownloadHistory.FileOverwrite}, {4}&&True</ifParams>
<then>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>from System.Net import WebClient; WebClient().DownloadFile(r"{3}",r"{1}\{2}")</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<if ifBlockDisabled="False" ifNot="False">
<ifType>LastActionSuccess</ifType>
<ifParams>&&</ifParams>
<then>
<action>
<cmdType>Map.Set</cmdType>
<params>
<param>DownloadHistory</param>
<param>{1}\{2}</param>
<param>{3}, {1}, {2}, {ShortDate}, {LongTime}, {Var.MachineName}</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>VcAdvanced.Log</cmdType>
<params>
<param>Error downloading {2} from {3}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<action>
<cmdType>Map.Set</cmdType>
<params>
<param>DownloadHistory</param>
<param>FileOverwrite</param>
<param>False</param>
<param>True</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<event>file.download</event>
</command>