Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. What is the problem, exactly? Try setting the random prior to the sleep, have the random in a variable and place the variable in the sleep, see if it makes any difference.
  3. Unfortunately it gets the same result. Hard coded works, but macro does not.
  4. What if you set the string prior to the cmd? $cmdvar = 'cmd /c "c: && cd\users\"'&@UserName&'"\appdata\local\microsoft && ren outlook outlookORIG"' Run($cmdvar)
  5. On the getpixel function I get @error 10 and @extended 2, just no idea what they are. On the bitmapcreate function I get @error 10 and @extended 7, just no idea what they are.
  6. Hello again, First - I apologize for posting in the wrong area. Second thank you for the responses. To try and be more clear, when I run the following command: RunWait('cmd /c "c: && cd\users\12345\appdata\local\microsoft && ren outlook outlookORIG"') The outlook folder does get renamed to outlookORIG But when I change 12345 to a variable name I haven't been able to get it to work. I tried the macro and syntax "careca" suggested: RunWait('cmd /c "c: && cd\users\"&@UserName&"\appdata\local\microsoft && ren outlook outlookORIG"') but still no luck. Thanks
  7. I was attempting to run two different functions simultaneously, at first i was just using two different scripts, but they seem to conflict with each other too often. i did some digging and found the following. https://www.autoitscript.com/forum/topic/19521-running-2-loops-at-the-same-time/ the only problem is im having issues getting this to use a sleep(random) to go with my script. if anyone can help me solve this, it would be much appreciated.
  8. #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() $g_hImage = _GDIPlus_ImageLoadFromFile("output.png") $bmp = _GDIPlus_BitmapCreateFromHBITMAP($g_hImage) $color = _GDIPlus_BitmapGetPixel($bmp, 776, 679) ConsoleWrite("Color at 776, 679 is "&hex($color)&@CRLF) _GDIPlus_Shutdown() I got Color at 776, 679 is 00000000 When I am using example to read .png and draw it on gui pixel color is >>>> Mouse <<<< Position: 776, 679 Cursor ID: 0 Color: 0x147A9C What I am doing wrong?
  9. Today
  10. How would the command hardcoded look like? Let's take an example with a variable or macro integrated: This is the string to take "C:\Users\W10\AppData\Local\AMD" This is what it looks like with macro: "C:\Users\"&@UserName&"\AppData\Local\AMD" This is with a variable: $var1 = "C:\Users\W10\" $var2 = "AppData\Local\AMD" $var1&$var2 Maybe show us the batch cmd or whatever it was and lets go from there.
  11. Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Moderation Team
  12. Ignore $LT and $Play as i said it was taken from another script, didn't have time to clean it up. As you can see in the parameters for this, $iState = 8 meaning the item is selected, so it retrieves the 0 based index of the selected item. $GetLTLV = _GUICtrlListView_GetNextItem($cListView, -1, 0, 8) BTW keep in mind it retrieves zero based index, so the first item in the list will be number 0 instead of 1, you got to account for that.
  13. in the help file, Macro Reference
  14. Hello, I'm a relatively new user and I could use some help. I'm trying to run a command to change to a certain folder and then rename a specific folder. The problem is that one of folder names is user specific (it's their user id). If I hard code the user id the command runs correctly. But if I insert a variable in place of the userid the command does nothing. I've tried various different syntax but to no avail. I know my inputbox is working because I've tested that value entered is correct. Here are the 2 lines: $userid = InputBox("User ID", "Please enter your PSEG User ID") RunWait('cmd /c "c: && cd\users\$userid\appdata\local\microsoft && ren outlook outlookORIG"') This was my original attempt. The script doesn't fail but it also doesn't change the outlook folder name. Since this attempt I have tried various versions of extra quotes and such but have had no luck. I've searched Help and forums but haven't found anything. Any help and/or suggestions would be appreciated. Thanks!
  15. Sure This is your actual code: Local $sSubject = "testing" ; subject from the email - can be anything you want it to be Local $sBody = "test" ; the messagebody from the mail - can be left blank but then you get a blank mail In the two variables, you are setting "testing" and "test". If you want to let the user fills those variables, you have to prompt to the user something, and, basically, you have two ways to do it: Create Graphic User Interface, from which the user could fill some text fields ( GUICtrlCreateInput()/GUICtrlCreateEdit() ); Have an InputBox ( which, in my opinion, should not be the best solution for you, since InputBox has small textbox ). In the first case, after creating the GUI, with a button, you should read the content of your text boxes ( or edits ) with the function GUICtrlRead(). You can take a look here for the first way, and here for the second one Best Regards.
  16. I think this is exactly what I'm looking for, but I'm a complete programming n00b. Can you explain a little bit more? I'm Googling but not finding clear examples.
  17. _Excel_RangeRead

    Using the UsedRange approach as posted by @JLogan3o13 is by far the best solution
  18. Just create two or more variables to store the content of the user input ( through a GUI or an InputBox ), and then set it to the subject and to the body. Look at GUICtrlCreateInput()/GUICtrlCreateEdit() and InputBox Best Regards.
  19. This gives me an idea for an alternative approach; however: perhaps you would explain how the code works, including why you call *_GetNextItem: to me this would search for the next selected item below the item clicked what are $LT and $Play?
  20. Rounding?

    Thank you very much.
  21. I can successfully send an email by double clicking my script here. I want to be able to double click this and have it pop up a text input for the subject and body (separately if possible). Bonus points if I could rename those pop up prompts to "Name:" and "Helpdesk Issue:" #include <File.au3> ; =============================================================================================================================== ; Variables for the _INetSmtpMailCom ; =============================================================================================================================== Global Enum _ $g__INetSmtpMailCom_ERROR_FileNotFound = 1, _ $g__INetSmtpMailCom_ERROR_Send, _ $g__INetSmtpMailCom_ERROR_ObjectCreation, _ $g__INetSmtpMailCom_ERROR_COUNTER Global Const $g__cdoSendUsingPickup = 1 ; Send message using the local SMTP service pickup directory. Global Const $g__cdoSendUsingPort = 2 ; Send the message using the network (SMTP over the network). Must use this to use Delivery Notification Global Const $g__cdoAnonymous = 0 ; Do not authenticate Global Const $g__cdoBasic = 1 ; basic (clear-text) authentication Global Const $g__cdoNTLM = 2 ; NTLM Global $gs_thoussep = "." Global $gs_decsep = "," Global $sFileOpenDialog = "" ; Delivery Status Notifications Global Const $g__cdoDSNDefault = 0 ; None Global Const $g__cdoDSNNever = 1 ; None Global Const $g__cdoDSNFailure = 2 ; Failure Global Const $g__cdoDSNSuccess = 4 ; Success Global Const $g__cdoDSNDelay = 8 ; Delay _Sendmail() Func _Sendmail() Local $sSmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED Local $sFromName = "user" ; name from who the email was sent Local $sFromAddress = "youremail@gmail.com" ; address from where the mail should come Local $sToAddress = "mailreceiver@gmail.com" ; destination address of the email - REQUIRED Local $sSubject = "testing" ; subject from the email - can be anything you want it to be Local $sBody = "test" ; the messagebody from the mail - can be left blank but then you get a blank mail Local $sAttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed Local $sCcAddress = "" ; address for cc - leave blank if not needed Local $sBccAddress = "" ; address for bcc - leave blank if not needed Local $sImportance = "Normal" ; Send message priority: "High", "Normal", "Low" Local $sUsername = "youremail@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED Local $sPassword = "xxxxxxx" ; password for the account used from where the mail gets sent - REQUIRED Local $iIPPort = 465 ; GMAIL port used for sending the mail Local $bSSL = True ; GMAIL enables/disables secure socket layer sending - set to True if using httpS Local $bIsHTMLBody = False Local $iDSNOptions = $g__cdoDSNDefault Local $rc = _INetSmtpMailCom($sSmtpServer, $sFromName, $sFromAddress, $sToAddress, $sSubject, $sBody, $sAttachFiles, $sCcAddress, $sBccAddress, $sImportance, $sUsername, $sPassword, $iIPPort, $bSSL, $bIsHTMLBody, $iDSNOptions) If @error Then MsgBox(0, "_INetSmtpMailCom(): Error sending message", _ "Error code: " & @error & @CRLF & @CRLF & _ "Error Hex Number: " & _INetSmtpMailCom_ErrHexNumber() & @CRLF & @CRLF & _ "Description: " & _INetSmtpMailCom_ErrDescription() & @CRLF & @CRLF & _ "Description (rc): " & $rc & @CRLF & @CRLF & _ "ScriptLine: " & _INetSmtpMailCom_ErrScriptLine() _ ) ConsoleWrite("### COM Error ! Number: " & _INetSmtpMailCom_ErrHexNumber() & " ScriptLine: " & _INetSmtpMailCom_ErrScriptLine() & " Description:" & _INetSmtpMailCom_ErrDescription() & @LF) Else Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(262208, "SUCCESS", ":-)", 5) EndIf EndFunc ;==>_Enviarmail #Region UDF Functions ; The UDF ; #FUNCTION# ==================================================================================================================== ; Name ..........: _INetSmtpMailCom ; Description ...: ; Syntax ........: _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress[, $s_Subject = ""[, $as_Body = ""[, ; $s_AttachFiles = ""[, $s_CcAddress = ""[, $s_BccAddress = ""[, $s_Importance = "Normal"[, $s_Username = ""[, ; $s_Password = ""[, $IPPort = 25[, $bSSL = False[, $bIsHTMLBody = False[, $iDSNOptions = $g__cdoDSNDefault]]]]]]]]]]]]) ; Parameters ....: $s_SmtpServer - A string value. ; $s_FromName - A string value. ; $s_FromAddress - A string value. ; $s_ToAddress - A string value. ; $s_Subject - [optional] A string value. Default is "". ; $s_Body - [optional] A string value. Default is "". ; $s_AttachFiles - [optional] A string value. Default is "". ; $s_CcAddress - [optional] A string value. Default is "". ; $s_BccAddress - [optional] A string value. Default is "". ; $s_Importance - [optional] A string value. Default is "Normal". ; $s_Username - [optional] A string value. Default is "". ; $s_Password - [optional] A string value. Default is "". ; $IPPort - [optional] An integer value. Default is 25. ; $bSSL - [optional] A binary value. Default is False. ; $bIsHTMLBody - [optional] A binary value. Default is False. ; $iDSNOptions - [optional] An integer value. Default is $g__cdoDSNDefault. ; Return values .: None ; Author ........: Jos ; Modified ......: mLipok ; Remarks .......: ; Related .......: http://www.autoitscript.com/forum/topic/23860-smtp-mailer-that-supports-html-and-attachments/ ; Link ..........: http://www.autoitscript.com/forum/topic/167292-smtp-mailer-udf/ ; Example .......: Yes ; =============================================================================================================================== Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $s_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance = "Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $bSSL = False, $bIsHTMLBody = False, $iDSNOptions = $g__cdoDSNDefault) ; init Error Handler _INetSmtpMailCom_ErrObjInit() Local $objEmail = ObjCreate("CDO.Message") If Not IsObj($objEmail) Then Return SetError($g__INetSmtpMailCom_ERROR_ObjectCreation, Dec(_INetSmtpMailCom_ErrHexNumber()), _INetSmtpMailCom_ErrDescription()) ; Clear previous Err information _INetSmtpMailCom_ErrHexNumber(0) _INetSmtpMailCom_ErrDescription('') _INetSmtpMailCom_ErrScriptLine('') $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject ; Select whether or not the content is sent as plain text or HTM If $bIsHTMLBody Then $objEmail.Textbody = $s_Body & @CRLF Else $objEmail.HTMLBody = $s_Body EndIf ; Add Attachments If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) Return SetError($g__INetSmtpMailCom_ERROR_FileNotFound, 0, 0) EndIf Next EndIf ; Set Email Configuration $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = $g__cdoSendUsingPort $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 Then $IPPort = 25 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = $g__cdoBasic $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = $bSSL ;Update Configuration Settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Low" EndSwitch ; Set DSN options If $iDSNOptions <> $g__cdoDSNDefault And $iDSNOptions <> $g__cdoDSNNever Then $objEmail.DSNOptions = $iDSNOptions $objEmail.Fields.Item("urn:schemas:mailheader:disposition-notification-to") = $s_FromAddress ;~ $objEmail.Fields.Item("urn:schemas:mailheader:return-receipt-to") = $s_FromAddress EndIf ; Update Importance and Options fields $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then _INetSmtpMailCom_ErrObjCleanUp() Return SetError($g__INetSmtpMailCom_ERROR_Send, Dec(_INetSmtpMailCom_ErrHexNumber()), _INetSmtpMailCom_ErrDescription()) EndIf ; CleanUp $objEmail = "" _INetSmtpMailCom_ErrObjCleanUp() EndFunc ;==>_INetSmtpMailCom ; ; Com Error Handler Func _INetSmtpMailCom_ErrObjInit($bParam = Default) Local Static $oINetSmtpMailCom_Error = Default If $bParam == 'CleanUp' And $oINetSmtpMailCom_Error <> Default Then $oINetSmtpMailCom_Error = '' Return $oINetSmtpMailCom_Error EndIf If $oINetSmtpMailCom_Error = Default Then $oINetSmtpMailCom_Error = ObjEvent("AutoIt.Error", "_INetSmtpMailCom_ErrFunc") EndIf Return $oINetSmtpMailCom_Error EndFunc ;==>_INetSmtpMailCom_ErrObjInit Func _INetSmtpMailCom_ErrObjCleanUp() _INetSmtpMailCom_ErrObjInit('CleanUp') EndFunc ;==>_INetSmtpMailCom_ErrObjCleanUp Func _INetSmtpMailCom_ErrHexNumber($vData = Default) Local Static $vReturn = 0 If $vData <> Default Then $vReturn = $vData Return $vReturn EndFunc ;==>_INetSmtpMailCom_ErrHexNumber Func _INetSmtpMailCom_ErrDescription($sData = Default) Local Static $sReturn = '' If $sData <> Default Then $sReturn = $sData Return $sReturn EndFunc ;==>_INetSmtpMailCom_ErrDescription Func _INetSmtpMailCom_ErrScriptLine($iData = Default) Local Static $iReturn = '' If $iData <> Default Then $iReturn = $iData Return $iReturn EndFunc ;==>_INetSmtpMailCom_ErrScriptLine Func _INetSmtpMailCom_ErrFunc() _INetSmtpMailCom_ErrObjInit() _INetSmtpMailCom_ErrHexNumber(Hex(_INetSmtpMailCom_ErrObjInit().number, 8)) _INetSmtpMailCom_ErrDescription(StringStripWS(_INetSmtpMailCom_ErrObjInit().description, 3)) _INetSmtpMailCom_ErrScriptLine(_INetSmtpMailCom_ErrObjInit().ScriptLine) SetError(1) ; something to check for when this function returns Return EndFunc ;==>_INetSmtpMailCom_ErrFunc #EndRegion UDF Functions
  22. Scrollbars Made Easy - New version 13 May 18

    Awsome UDF!!! Congratulations Melba. Can you tell me if there is a Help with all the commands? Im trying to scroll with a mouse whell after create another contol but i did not works. Even if i put "_GUIScrollbars_Generate($GUI, 1, 1000)" after creates a control like a label Thankyou!!
  23. _Excel_RangeRead

    I ended up using a txt file for right now just to get the job done and will rewrite it using the excel file a little later and post.
  24. _Excel_RangeRead

    @JLogan3o13 Yes this is what I am seeing.
  25. CronToTime.au3 UDF converts a Unix Cron expression into a DateTime string. On Unix systems a Cron expression made of five fields separated by blanks/tabs followed by a shell command to execute. e.g. 15-30 2,3,4,5 29 1-12 0-6 reboot +------------- minute (0 - 59) ¦ +------------- hour (0 - 23) ¦ ¦ +------------- day of month (1 - 31) ¦ ¦ ¦ +------------- month (1 - 12) ¦ ¦ ¦ ¦ +------------- day of week (0 - 6) (Sunday to Saturday, 7 is also Sunday) ¦ ¦ ¦ ¦ ¦ +------------- some shell command ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ * * * * * reboot (In this UDF the 6th field has no meaning and no influence on the result). For more information see https://en.wikipedia.org/wiki/Cron Finds the next event of the specified Cron expression, starting from current UTC/GMT. _pce_findNextTimeUTC($sCronExp [, $bForwardSearch = True [, $minutesOffset = 0]]]) Finds the next event of the specified Cron expression. If $sDateTime is not set, local time will be used. _pce_findNextTime($sCronExp [, $bForwardSearch = True [, $sDateTime = "" [, $minutesOffset = 0]]]) Convert names in usable Cron expression values. e.g. "15-30 2,3,4,5 29 July-December Mo-Su" to "15-30 2,3,4,5 29 7-12 1-7" _pce_convertNames( $sCronExp ) See the include for details. CronToTime_Test.au3 CronToTime.au3
  26. _Excel_RangeRead

    I have always used $oWorkbook.ActiveSheet.Usedrange.Columns("A:A") rather than just "A:A", otherwise it tries to pull every cell in the column, used or not.
  1. Load more activity
×