jpg
bye
550 | Chapter 9: Scripting and Automation
Next, you??™ll want to set up a scheduled task to repeatedly run the script; the
interval (five seconds, five minutes, etc.) depends on your needs and the
capabilities of your system. Lastly, if you haven??™t already done it, create a
web page that references the fish.jpg photo; just visit the page to view a current
picture of your fishtank, from anywhere in the world. You can even
include JavaScript code in the page to automatically reload itself and update
the picture after a certain delay.
This script requires the following subroutines, found earlier in this book:
FileDelete, FileExists, and RunProgram.
Quick SendTo Shortcut Creator
Explorer??™s SendTo menu contains a list of programs and shortcuts to which
any selected file can be sent. The idea is to list programs that could be used
with any type of file, such as an email program or file viewer, without having
to specifically set up file associations for each supported file type. The
following script (Example 9-5) allows you to right-click on any application
executable (.exe file), folder, or drive and create a shortcut in the SendTo
folder on the spot.
Whenever you can, you should try to make your scripts ???smart.??? If you
wanted to be lazy, all you??™d need is the second line of this script, which creates
a shortcut based on the command-line parameter (see ???How to Use
Command-Line Parameters,??? earlier in this chapter, for details).
Pages:
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767