Sign in to follow this  
Followers 0
PhoenixXL

Remote Gmail (UDF)

70 posts in this topic

#1 ·  Posted (edited)

Remote Gmail UDF


Working
It uses the Google atom API to get the Summary of the mail,
The Summary of the mail is enough to get a direct link or a single function with parameters
Execute any Function (or Script) and get the Return Values in your E-mail

Requirements

  • Gmail (Email) Account
  • A Remote Computer with Internet Access

Representation
remotegmail.png
Functions

  • You can now use you Gmail account to use Autoit Functions in a remote computer
  • Can execute a function through reading the email.
  • Can Email back the return values of an executed function.
  • The parameter can even be a variable present in the script [see Syntax]
  • Execute a Script through Direct Link.
  • Execute multiple scripts zipped together through Direct Link.
  • Can Email back the PID of the running executables with the scripts.
  • Attach any file and get it in your email.
  • Able to send the multiple attachments zipped together.
  • Writes all the return values in a Log file.
  • No email is executed twice, the Message IDs are stored for this purpose.

Future Updates

  • Support single line nesting
  • Get the attachment, to execute the script

Syntax

Syntax for Functions
PXL<FuncName>: (<data type>)<first param part a>+(<data type>)<first param part b>|(<data type>)<secondparam>/PXL

Colon[:] - Separation of Function Name with the Parameters
Bar [ | ] - Separation of different parameters
Plus [+] - To Concatenate Values
PXL /PXL - The tags where the code is enclosed
Brackets [ () ] - For specifying the type of the parameter

DataTypes - Always Preceded by any parameter and are enclosed with brackets

; | (s) - String
; | (n) - Number
; | (f) - Floating Number
; | (i) - Integer
; | (b ) - Binary
; | (v) - Variable
; | (h) - Hex
; | (m) - macro
; | (w) - Handle
; | (p) - Pointer


Syntax for Direct Links
PXL<DirectLink>^<Type>/PXL

PXL /PXL - The tags where the code is enclosed
Caret [ ^ ] - To Separate the Link and the Type
Type - Either Zip or au3

DirectLink WebServer
Some of webservers providing Direct Links
DropBox [Tested - Recommended]
Herosh [Tested]*
FileToLink
FileDen

* DirectLink from Herosh changes therefore Example 4 wont work after a while

Credits
CaptainClucks - Atom Feed
Jos - SMTP Mailer
wraithdu - Zip UDF

Change Log
v1.0 - First Release
v1.1 - Added Script Execution with Zipping Functionality
v1.2 - Fixed some Minor bugs
v1.3 - Added RemoteGmail_Startup
v1.4 - Fixed Compiling Issues

v1.5 - Added flexibility for execution of scripts from any email.

The UDF - Download
The UDF is currently tested on x86
All Comments ,Queries , Feedback and Advice are welcomed... :)
The UDF with the Examples have been compiled in the following Zip

v1.5 RemoteGmail.7z
Previous Downloads : 1119

Regards
Phoenix XL

Edited by PhoenixXL
4 people like this

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites



24 Downloads yet no Reply

Please give me Feedback and Suggestions

Regards

Phoenix XL

1 person likes this

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

hI, GREAT IDEA, you can have a look AT mine here, similar THAN yours, but using a mysql db instead, it includes also a browser link to work for starting the script from an IPHONE-ANDROID smartphone --> INTO a autoit APP Client(via php and mysql and this remote Autoit app client)

I write there a link also for another internet "automator".

I posted your script-link in our Autoit SPANISH SUPPORT GROUP FORUM HERE:

LINK

THANKS

SALUDOS

PD: España-France Football MATch IS tomorrow.

Edited by BasicOs

Autoit.es - Foro Autoit en Español Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http

Share this post


Link to post
Share on other sites

This is pretty smart - I can see that this has great potential. Nice work.

-CptSpike

Share this post


Link to post
Share on other sites

v1.1 has been released

Check the First Post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

hI, GREAT IDEA

Thanks BasicOS :) Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

thanks CptSpike :graduated:

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

oops forgot to add the script.. :rolleyes:

.

.

please check the first post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

Hi Phoenix, a good tool for administering network remotely. I downloaded, but could not understand how to go configuring remote computers and put them in to listening mode.

Is there any help file showing how to start?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

This will help you achieve a continuous loop to check and execute the emails till the compter isnt turned off or the Process isnt killed

;For Version 1.2 only
;Check Continuously
Opt('TrayIconDebug', 1)


Global $sUsername = 'myusername' ; Your Username for Example if phoenixxl@gmail.com is your Gmail Address then phoenixxl would be your username
Global $sPassword = '********' ; Your Password for your Gmail Account
Global $iTimeOut = 12000
#include <RemoteGmail.au3>

;The Function would be executed every 12 Seconds.
;Hence all the New mails would be checked and executed every 12000 milli Seconds
AdlibRegister('RemoteGmail',$iTimeOut)

;Our Infinite Loop
While 1
Sleep(10)
WEnd

Just give your username and password

Send yourself an email with your email address and get the script or Function executed

One more tip : to execute the mails when user goes idle check Idle Process in my Signature

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Hello Pheonix

I found a bug; it's in the part where _ExecuteFromEmail function is calling _GetfromDirectLink function; first parameter contains the ^zip in it so the link is incorrect; _GetfromDirectLink function do'nt catch the error, so _ExecuteFromEmail crashes because $nArrays is not a array. My correction (simplest for me) was this:

Local $nFile = GetfromDirectLink(StringTrimRight($sExecute, 4), @ScriptDir &amp; 'Temp.' &amp; $nType)

Anyway, great job, i was using a script similar with this, but yours is much better; thank you, and maybe we'll expand it; I have some ideas, but I will post them later.

Thanks , Paul

edit: sorry for my bad english

Edited by kiu

Share this post


Link to post
Share on other sites

Thanks kiu,

I have updated the UDF

please check the first post


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

thank you for sharing it. :ILA2:


Thanksgiving...

Share this post


Link to post
Share on other sites

When I try to start any code i get error from string.au3

Func _HexToString($strHex)

If StringLeft($strHex, 2) = "0x" Then Return BinaryToString($strHex)

Return BinaryToString("0x" & $strHex)

EndFunc ;==>_HexToString

Its says that missing wend, endswitch. I try to change something and I get errors from remotegmail.au3 .

I make ant imput box with button. I want to put there text, click button and get text into gmail .

Share this post


Link to post
Share on other sites

Such messages are (most of the time) not caused by the UDF but by the user code missing a closing quote or something like that.

Running Tidy has often shown where the problem is.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Just tried your script you sent me by PM and it works fine. Autoit 3.3.8.1, latest GMail UDF. Running on Windows 7 64 bit.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thats strange. I get errors from udf. Need to check my autoit version. Also my win is xp.

Share this post


Link to post
Share on other sites

Can you post the output of the SciTE console pane? Which error messages do you get there? Line number etc?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3(10,29) : WARNING: $sUsername: possibly used before declaration.
Global $sEmail = $sUsername &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3(60,53) : WARNING: $sPassword: possibly used before declaration.
Local $eReturn = _CheckGmail($sUsername, $sPassword,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailTest.au3 - 0 error(s), 2 warning(s)
->13:41:40 AU3Check ended. Press F4 to jump to next error.rc:1
>Running:(3.3.8.1):C:Program FilesAutoIt3autoit3.exe "C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailTest.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:Documents and SettingsxxxxDesktopRemoteGmailv1.2 RemoteGmailRemoteGmail.au3 (10) : ==> Variable used without being declared.:
Global $sEmail = $sUsername & '@gmail.com'
Global $sEmail = ^ ERROR
->13:41:40 AutoIT3.exe ended.rc:1
>Exit code: 1 Time: 2.618
You access a variable ($sUsername) before it has been declared. Move the variable declaration/assignment to the top of your script (before the GMail include) and the error should go away:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $sUsername = "myemail"
Global $sPassword = "password"
Global $texttosend

#include <RemoteGmail.au3>

#region ### START Koda GUI section ### Form=
GUICreate("Test", 300, 72, 296, 260)
$Input1 = GUICtrlCreateInput("Put some text", 8, 8, 281, 21)
$send = GUICtrlCreateButton("Send Gmail", 8, 32, 283, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
          Exit
        Case $send
            $texttosend = GUICtrlRead($Input1)
            SendEmail2Gmail($texttosend, '', 0, 'Execute')
    EndSwitch
WEnd
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks!So stupid mistake. When I tried to put that variables before includes then I got errors from string.au3..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • robcull
      By robcull
      Hello all! I have had some issues reading text from different types of windows, occasionally, specifically with controlgettext. 
      **Before I begin, I know there are better ways to do what I attempt in the example below. That's not the point of this post. The point is my issues with controlgettext. 
      I am about to cite an example with an application you may be familiar with called SpeedFan (v4.52). My problem is not specific to speedfan, it is simply the most recent and easily reproducible example I can think of. 
      So, the goal of the script below is to get a string of text containing the current fan RPMs from the highlighted control in the screenshot below (see "speedfan_control_details.png").

      Now, here's a simple script for grabbing the window handle and reading the text from that control: 
      $wintitle = "SpeedFan 4.52" $controlID = "197934" ;will be reformatted as "[ID:######]" $hwnd = wingethandle($wintitle) if @error<>0 then msgbox(0, "WinGetHandle", "FAILURE. @error="&@error) Exit EndIf $text = ControlGetText($hwnd, "", "[ID:"&$controlID&"]") if @error=1 then msgbox(0, "ControlGetText", "FAILURE. @error="&@error) ;failure returns "" and @error=1 Exit EndIf msgbox (0, "ControlGetText", "SUCCESS. @error="&@error &@CRLF& "$text="&$text) ;success returns string and @error=0 You'll see that the ControlGetText operation runs without error, however it does not capture any text from the control. If you explore the other controls in this one window, you'll find mixed results across the board. Neither the temps nor voltages can be read, while the log field and some other elements can be read. Even when you read the text from the whole window, those elements are not included in the visible nor hidden texts. 
       
      I have run into this issue many times in the past- inconsistencies in the ability of autoit to interact with certain controls. What is it which makes this text different than any other readable texts? Is there an alternate method of reading the text in the window/control which could work? Any and all info to help me solve this mystery and satisfy my curiosity would be greatly appreciated. 
      Thanks  -Rob C
      PS: Running Autoit v3.3.14.2 on Win7 Ultimate x64
    • TheDcoder
      By TheDcoder
      Hello, I recently opened a bug report without reading the Helpfile... My bad . After @Melba23's gentle reminder, I was curious about why it was like that.
      It is about SetError's behaviour. This is the example from the bug report:
      Example() If @error Then ConsoleWrite("Error" & @CRLF) Else ConsoleWrite("No Error" & @CRLF) EndIf Func Example() SetError(1) Sleep(1000) EndFunc What I tried to do is set Example's (my user defined function's) @error value to 1... but the value set by SetError is cleared after calling a function, I wonder why? Why should calling to an external function effect my function's @error which is set when my function returns.
      Setting the error of a UDF in advance by using SetError makes sense... but I cannot find a reason why calling a function should clear it? Please note that I am not talking about @error, I am talking about the @error set by my function when it ends/returns!
      I hope someone can enlighten me, thanks for the answers in advance!
      P.S I tried to explain my best but my English is not very good and I didn't feel like I did a good job explaining today, so please pardon any mistakes that I have made
    • nacerbaaziz
      By nacerbaaziz
      hello guys
      how are you؟
      I hope to be fine.
      I have a question  please
      how do I get the menu item that was pressed without that contains a variable؟
      For example I have a menu  of Favorites and I want the script recognizes the existing path in the pressed item
      i'll repeat to tell the item does not contain a variable
      Is there any solution
      if you want to explain more I could write an example of what I want.
      Greetings to all,
      thanks in advance
    • Skeletor
      By Skeletor
      Hi Guys, 
      So with me working in my Virtual Machines in full screen, I often have my Host OS playing music. Now the issue I had was trying to control the Host OS without having to minimise the Guest OS.
      So I thought of this small program. I call it the Volume Control. It resides in the bottom right hand corner of your screen just above the system clock. 
      I'm still working on getting the volume buttons to increase/decrease when you hold down the button.
      Currently, you will need to tap on the volume buttons numerous times to decrease/increase the volume. 
      Any other improvements let me know. 
      The source code, icon and compiled program are already in the zip. 
       

       
      Volume Controlv1.zip
      Screenshot.bmp
    • spuuunit
      By spuuunit
      This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:
      While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.