Plugin ras.spf

File: ras.spf
Author: Nicholas Nemtsev
Description: Opens the default dialing program and starts dialing a remote connection. Connection is made "in the name" of the same user in whose name this task is executed.
System requirements: WinNT/2000/XP

New words:

DIAL-DLG: "ras_entry"

Dials the specified remote connection. After completing its work, word DIAL-DLG: returns TRUE if the connection was successfully established.

Please note that word DIAL-DLG: returns a flag. That means that this word should be used with an IF ELSE THEN construct, or the value returned by DIAL-DLG: should be explicitely cleared from the stack.


#( download-task
\ when an Internet link is copied into a clipboard, start a 
\ download manager and, if necessary, establish an Internet connection
User: "Nicholas" SecPassword: "sdfljwoer" LogonInteractive
WatchClipboard: "*"
\ creating a regular expression
: wget1-mask S" /(http)|(ftp)|(https):\/\/[^ ]+?\.(zip)|(rar)|(exe)|(pdf)|(gz)|(jpg)|(jpeg)|(txt)/i" ;
Rule: RE-MATCH: %CLIPBOARD% %wget1-mask%
RE-ALL: %CLIPBOARD% %wget1-mask%
\ querying the user with the help of a message box:
QUERY: "Download?%crlf%%$0%"
    ONLINE? 0=
        \ dialing an Internet connection unless we already have one established
        DIAL-DLG: MyProvider
THEN IF \ starting a download manager StartIn: e:\home\download ShowMinimized START-APP: E:\bin\wget\wget.exe %$0% THEN THEN ;RE-ALL )#