You’ve Got Mail

06-07-2011 11:13 AM
Labels (1)
by Anonymous User
Not applicable
1 0 603
Let's pretend you've been tasked to build a geoprocessing model to automate some of your department's data management tasks while everyone is out of the office. Since ModelBuilder doesn't have any magic buttons for scheduling times to run or people to email, you're going to have to go "outside of the box" to make this happen and be the office hero.

Thankfully, there's already a handy technical article that outlines the steps for using Windows task scheduler to run the script at a prescribed time:HowTo:  Schedule a geoprocessing script to run at prescribed times

So, now things are running smoothly... until your boss requests an email be generated confirming successful completion of the job. You can either get to the office at dawn to verify and send out this email, or you could let Python do the work for you!

The script below is written to work so that an email is generated once the called model completes. When the model has finished, the email's subject displays, "Python script has completed," and the message body is populated with the geoprocessor results messages. The script can also be modified easily to meet new requirements as they are identified.Download Python ScriptDarrin C. - Desktop Support Analyst