Tuicemens

Pages: [1] 2

Author Topic: Way to get a SmartMacro to send Gmail with attachment ?  (Read 1413 times)

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Way to get a SmartMacro to send Gmail with attachment ?
« on: March 19, 2018, 06:19:27 PM »

I have been setting up some macros to trigger taking video and snapshots based on motion sensors.  They work well.

It would be nice if I could find a way to:
1) copy the files (snapshots / videos) just taken to my Google Drive
2) send me an email that new info has just been uploaded

I've searched this board as well as the X10 forum and there is some info, but most of it is quite old and not really sure it would still work.  I tried messing around using the "Execute Windows Program" calling a script but I am not sure what the arguments would be to pass info on the files (hope that makes sense).

Figured it was worth a shot to ask the question here - this board seems to get more activity than the x10 Forum (at least the SmartMacro sub topic).

Thanks
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #1 on: March 19, 2018, 06:49:52 PM »

since AHP was never updated past 3.318 the info you've found on windows commands should still work.
That being said AHP was never designed to work in a 64 bit OS and Windows 10 has some additional security issues that may come into play.
if you have a script that does the task you wish you can just add the path to the script (including the script name and extension) in the Windows command, no arguments needed.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #2 on: March 19, 2018, 07:32:44 PM »

Only info I couldn't find was about passing arrguments for the pic files to the script via the smart macro windows command.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #3 on: March 19, 2018, 09:46:43 PM »

How are you sending the email notification?
With AHP or the script?
Emails from AHP were never very reliable (for me) And I'm not sure they still work being tied to the my house plugin
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #4 on: March 20, 2018, 05:56:35 AM »

Trying to pass to the windows command line.  Usually there are conventionslike $F for file or percent (no percent key on my phone, I know weird) F type stuff, but I don't see anything like that for the windows command line feature from smartmacro.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #5 on: March 20, 2018, 08:24:16 AM »

So your macro starts a script and the script excepts arguments?
Some arguments need to be placed inside quotes("") for AHP so send correctly.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #6 on: March 20, 2018, 10:04:16 AM »

Ok, so don't think I am explaining this right.

As part of a macro, I want to add a step to use the Windows Command Line which has two Fields - one for the program and one for the arguments.

I have a command line script to call, but I want to pass the name of the pic files triggered from the macro to the command line as arguments.

Is that possible?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #7 on: March 20, 2018, 11:48:10 AM »

Only if your script excepts command line arguments and your pic location and names are always the same.
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #8 on: March 21, 2018, 04:26:05 PM »

Hmm, that wont work then.  The file name is different all the time, was hoping there was some wild card ability that could be used.
Logged

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #9 on: March 21, 2018, 07:40:33 PM »

OK, I think I over complicated it from the start.

What I have now is AHP saving the Pics and Videos to a Google Drive folder.  Then all I gotta do is open Google Drive on my phone or computer and pull up the pic or video.  Only issue is I wont know specifically which one was added, but hey is pretty much what I was looking for.

Then I use the Execute Windows Command to just send me an email (and I can actually send myself a text, by emailing my cell phone).  That gives me the notification I was looking for (still setting this up, but in theory it will work).  It also gives the the pics and videos in a place I access them remotely.

Now the problem is tryu
Logged

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #10 on: March 21, 2018, 08:21:01 PM »

Success.  Got it working.  Using an application called SwithMail that lets you send Gmail using the command line, and have that set up as the last step in the SmartMacros I have using the Execute Windows Command.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #11 on: March 22, 2018, 07:15:29 AM »

glad to see you have it working the way you wish `:)
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #12 on: March 23, 2018, 06:33:13 PM »

So sort of related, I had to reboot my computer and when I started it up again the macros were not working.  I looked at them and the arguments portion of the execute windows command was missing most of the info - it only had a few chars.

So I updated them again.  Making sure I saved.

I exited AHP and started it up again and the same thing happened.

I fixed them again, but I don't want to have to do this every time I have to start AHP.

Anyone had a similar issue before?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3698
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #13 on: March 23, 2018, 07:59:30 PM »

if your running windows 10 64 bit be sure you run AHP as administrator even if logged on as one  else settings don't always get saved correctly
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

soxfan1966

  • Forum Supporter!
  • Sr. Member
  • *****
  • Helpful Rating: 1
  • Offline Offline
  • Posts: 123
Re: Way to get a SmartMacro to send Gmail with attachment ?
« Reply #14 on: March 24, 2018, 05:52:28 AM »

Ugh, that seems to be a problem not sure if its the problem specifically.  If I right click and Run As Administrator the configuration (devices and marcos, etc) is very different than if I just click on the program to start it up.  It looks like an older version of my settings.  The weird part is it seems to be opening the same file, but different versions of it.
Any way you know of getting those in synch, I would hate to have to manually update the Administrator version with everything new I have.
Logged
Pages: [1] 2