'' I recommend running this with wscript.exe instead of cscript.exe ' '' Requires the installation of ImageMagick () ' '' read, resized acdording to the command line arguments, then saved back into ' If the created file was of type jpg, the file is ' When a file is created, the Resize function is called by ' '' This script uses a Windows folder watch process to monitor a given folder for ' So now that we have a WatchFolder sub, how is it used? Here is the front end. If you have not provided a handler for that event (passed a null string) then what results is Execute "" If you have provided a handler to handle the Create event - for this example, let's assume you have created a function Function Resize(file)Īnd you have copied myfile.jpg to the watched folder - what will result is the execution of the string (assuming you are watching the folder D:\temp\resize) Resize("D:\temp\resize\myfile.jpg") vbScript does not do callbacks so we simulate that functionality with the Execute command. Once we execute the query we enter a loop which does nothing but wait for events which are then farmed out to external handlers. It is not necessary to add vbCrLf (carriage return/line feed) except that it makes the query easier to read when displayed to the console (code is for humans to read).
0 Comments
Leave a Reply. |