19720RE: [Clip] Showing messages
- Sep 29, 2009John Shotsky wrote:
>I've written several .hta files now, and they are working out just fine.It seems ^!IfError works with ^!Shell, so that's a starting point.
>However, sometimes a user will not have downloaded one of the files,
>so I'd like to create a message with a link to my
>FTP site so they can download the missing files. This would only be
>invoked if the subject .hta file was not present on
>the user's computer in the designated folder (Notetab's
>Libraries\Info folder). If possible, I'd further like it to
>automatically log into the FTP site so they can just click on the
>appropriate file, or even automatically send the FTP
>site the correct command to download the appropriate
>file. Anonymous FTP is not supported on my site to keep looky-loos
>out, so a user name and password need to be sent to the site. If
>login is not possible, I'll just include the username
>and password in the message.
Just to demonstrate..
^!IfError next else end
You'll get the Windows error first and when that's clicked away the
info box will pop up. If you replace 'bla.exe. with a program that
does exist, for example 'calc.exe', you'll see that the info box does
not show up.
One way to go would be to use ^!Continue (in place of the info box above).
^!Continue An info file is missing. Do you want to download it now?
There's a command line utility called ftp.exe present on all Windows
system. To be honest, I don't really *know* if it's there on Vista,
but I hope so. Notetab can work with that.
If you use the -s flag in the command line, ftp.exe will read
commands from an external file. Notetab has a directory called
Scripts with some sample files with the .scr extension that contain
FTP instructions. I don't think it's necessary to use either that
location or extension, but I've kept doing so.
This is what one of my scr files for downloading a certain file looks like.
'ftp.example.com', 'user' and 'password' should be replaced with the obvious.
LCD - here you specify the local directory you want the file to be
downloaded to. Note, it must be a DOS path, shortname or what's it
called, this kind of stuff: C:\NOTETA~1\DOCUME~1\
CD - change directory on the server. You must go to the right
directory first, then...
GET - download the specified file
Then you run it from Notetab like so:
h="Get HTA from FTP"
; Here you enter the DOS path to your -src file
^!ShellWait C:\WINNT\System32\FTP.exe -s:^%script%
^!ShellWait works like ^!Shell, but it halts clip execution until the
program it runs (ftp.exe) has finished what it's doing. I use this
because I want to open (run, in this case) the file after it's
downloaded and don't want to do it prematurely.
So, combine the above, mix and stir and you are all set. Have fun! :-)
- << Previous post in topic Next post in topic >>