Emailing a screenshot | Windows automation basics #MJT-SC001

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury, Rain

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 478
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Emailing a screenshot | Windows automation basics #MJT-SC001

Post by Dorian (MJT support) » Wed May 08, 2013 5:31 pm

This macro will capture any visible area of your screen, and send the image by email.

Any tweaks, variations, or additions to this script/thread are encouraged.

Demonstration :
http://youtu.be/IBjKhpkmT98

Source code :

Code: Select all

//Save this macro and assign it a hotkey.

//Email parameters. Edit these :
Let>SENDMAIL_STATUS=1
Let>subject=Test Screenshot
Let>me=myname@myplace.com
Let>myname=Mr Smith
Let>recipients=recipient@hisaddress.com
let>body=Here is my screenshot
let>mailserver=post.mail.com

// Instructions.  You can comment these out. 
let>MSG_HEIGHT=250
let>MSG_WIDTH=575
messagemodal>Instructions : %CRLF%1. Move mouse to top left corner of the screenshot area, and press LEFT CTRL%CRLF%2. Move mouse to bottom right corner of the screenshot area, and press RIGHT CTRL.%CRLF%3. Enter an email recipient and click OK%CRLF%%CRLF%Remember to click this message away before you start.  :)

// wait for LEFT CTRL depress, and store top left mouse position
WaitKeyDown>VK162
getcursorpos>TLX,TLY

// wait for RIGHT CTRL depress, and store bottom right mouse position
WaitKeyDown>VK163
getcursorpos>BRX,BRY

//Capture the specified area and store the image
ScreenCapture>TLX,TLY,BRX,BRY,%TEMP_DIR%\screenrect.bmp

//Send the email and attachment
SMTPSendMail>recipients,mailserver,me,myname,subject,body,%TEMP_DIR%\screenrect.bmp
Message>Result of SendMail: %SMTP_RESULT%


#MJT-SC001
Always accepting custom script commissions. Message me or go here

User avatar
CyberCitizen
Automation Wizard
Posts: 720
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu May 09, 2013 2:31 am

Good little script, I use Fastone Screen Capture by default, but that could be a useful freeware way of doing it for users.
FIREFIGHTER

macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

Re: Emailing a screenshot | Windows automation basics #MJT-S

Post by macroman » Mon Aug 08, 2016 12:07 am

wonder how we can use gmail to send out

User avatar
CyberCitizen
Automation Wizard
Posts: 720
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: Emailing a screenshot | Windows automation basics #MJT-S

Post by CyberCitizen » Mon Aug 08, 2016 12:09 am

You should be able to use gmail as well, you do need to allow older auth methods in gmail. Simple change.
FIREFIGHTER

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 478
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Emailing a screenshot | Windows automation basics #MJT-S

Post by Dorian (MJT support) » Wed Aug 10, 2016 12:24 am

Just an FYI, I just posted my latest "screenshot macro".

It doesn't email the screenshot out, but it has some other cool features instead.

Check it out here.
Always accepting custom script commissions. Message me or go here

User avatar
CyberCitizen
Automation Wizard
Posts: 720
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Re: Emailing a screenshot | Windows automation basics #MJT-S

Post by CyberCitizen » Wed Aug 10, 2016 1:30 am

macroman wrote:wonder how we can use gmail to send out
https://www.mjtnet.com/blog/2012/10/03/ ... via-gmail/
FIREFIGHTER

Post Reply