Jump to content

baconaise

Active Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by baconaise

  1. @mistersquirrle It was the $FO_OVERWRITE that fixed it. Thank you!
  2. I'm missing something. Documentation says, "If you want to use an ini file with Unicode encoding, first create an .ini file by using the FileOpen() function with the mode parameter set to a Unicode parameter." So, I start with: FileOpen(@MyDocumentsDir & "\Test\Save.ini",$FO_UTF8) Then, I do my: IniWrite(@MyDocumentsDir & "\Test\Save.ini", "Example", "Test1", $Temporary_Text) FileClose(@MyDocumentsDir & "\Test\Save.ini") But, it has the same issue as before. What am I missing?
  3. Hello! I am using IniRead() and IniWrite() to interact with save.ini. I need to use a rarely-typed character as a delimiter, but all the rarely-typed characters I try break upon saving (e.g. Θ turns into T). Is there a list of characters which will not break when I IniWrite() them? Edit: The solution is to add BitOR($FO_UNICODE, $FO_OVERWRITE) to the IniWrite line, so it looks like this: Local $Save_File = FileOpen(@MyDocumentsDir & "\Test\Save.ini",BitOR($FO_UNICODE, $FO_OVERWRITE))
  4. @jchd I've been playing with this since yesterday, and I can't seem to sort out the regular expression quite properly. If I use your first recommended ([^#]*)(#[^#]*#), it lets me use multiple clicks and sleeps in a row, but forgets to type anything after the last click/sleep. If I use your amended ([^#]*)(#[^#]*#)*, it types the stuff at the end, but doesn't allow for consecutive slicks/sleeps. Is there some way to allow consecutive clicks/sleeps while still making sure to type the stuff at the end? Edit: I think I fixed it. Func F1_HotKey() Local $Text_To_Send = GUICtrlRead($Text_Field) Local $Array_Of_Text_To_Send = StringRegExp($Text_To_Send,"([^#]*)(#[^#]*#)([^#]*)", 3) For $s In $Array_Of_Text_To_Send If StringLeft($s, 1) = "#" Then Execute(StringRegExpReplace($s, "#", "")) Else Send($s) EndIf Next EndFunc
  5. That was fantastically helpful. How do I buy you a beer?
  6. @jchd Would it be difficult to augment it in such a way that the other Send tricks still work (like {TAB})? Ideally, I'd like those to still work. Ideally ideally, I'd also like to be able to put in a command like {SLEEP 500} and have it sleep half a second when it gets to that point in the text.
  7. Absolutely nailed it. Thank you.
  8. @jchd Well, that's a huge improvement. It's nearly perfect. I'm going to have to study it for a while in order to understand it. The only thing it's missing is it forgets to type the period after world.
  9. Hello! I had to remove Next because there wasn't a For for it. I'm not sure where you got $s from, but I didn't get anywhere by declaring it prior to the function. I'll admit I'm reasonably mystified by StringRegExp. I've not used it before.
  10. Certainly! This is my basic idea: #include <GUIConstants.au3> AutoItSetOption("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $aGUI = GUICreate("", 300, 100) Global $Text_Field = GUICtrlCreateEdit("Hello{MouseClick('left',100,100)} world{MouseClick('left',200,200)}.", 0, 0, 300, 100, $ES_MULTILINE+$WS_VSCROLL) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Events") GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUI_Events") GUISetOnEvent($GUI_EVENT_RESTORE, "GUI_Events") GUISetState(@SW_SHOW,$aGUI) HotKeySet("{F1}", "F1_HotKey") While 1 Sleep(10) Wend Func GUI_Events() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE Exit EndSelect EndFunc Func F1_HotKey() Local $Text_To_Send = GUICtrlRead($Text_Field) Local $Array_Of_Text_To_Send = StringSplit($Text_To_Send,"") ;but somehow separate out clicks For $i = 1 to $Array_Of_Text_To_Send[0] ;and sequence them in this loop Send($Array_Of_Text_To_Send[$i]) Next EndFunc
  11. My goal is to use a hotkey to Send() text acquired from the GUICtrlRead() of an edit field on a GUI. So far, so easy. The challenge: Midway through the string returned by GUICtrlRead() (and sometimes more than once), will be a string like {MouseClick("left", x, y)}. When the program reaches that part of the string, I would like it to click at the coordinates specified; then, continue with SEND(). My original plan was to use StringSplit() with the clicks as delimiters. In theory, to loop through the array of strings, clicking when necessary. My plan doesn't seem like it will work because x and y will be unpredictable numbers, and I'm not sure how to overcome that impediment. I welcome any thoughts. Edit: This is my code so far. #include <GUIConstants.au3> AutoItSetOption("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $aGUI = GUICreate("", 300, 100) Global $Text_Field = GUICtrlCreateEdit("Hello{MouseClick('left',100,100)} world{MouseClick('left',200,200)}.", 0, 0, 300, 100, $ES_MULTILINE+$WS_VSCROLL) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_Events") GUISetOnEvent($GUI_EVENT_MINIMIZE, "GUI_Events") GUISetOnEvent($GUI_EVENT_RESTORE, "GUI_Events") GUISetState(@SW_SHOW,$aGUI) HotKeySet("{F1}", "F1_HotKey") While 1 Sleep(10) Wend Func GUI_Events() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE Exit EndSelect EndFunc Func F1_HotKey() Local $Text_To_Send = GUICtrlRead($Text_Field) Local $Array_Of_Text_To_Send = StringSplit($Text_To_Send,"") ;but somehow separate out clicks For $i = 1 to $Array_Of_Text_To_Send[0] ;and sequence them in this loop Send($Array_Of_Text_To_Send[$i]) Next EndFunc
  12. Hi pixelsearch, That prevents the program from crashing when I switch windows, but it does not provide me GUIGetCursorInfo for any new windows I click. Given that I was intending to use this program to identify ControlIDs of other windows, I can't say it solves my issue. Thank you for trying.
  13. Good evening, I wrote a short program intended to help me determine Control IDs, but it crashes when I change the window focus to anything else. #include <GUIConstants.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) GUICreate("ControlID Decoder",300,115) GUISetFont(12) GUISetOnEvent($GUI_EVENT_CLOSE, "Decoder_Events") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Decoder_Events") GUISetOnEvent($GUI_EVENT_RESTORE, "Decoder_Events") Global $Window_Label = GUICtrlCreateLabel("Active Window:",5,5,290,24) Global $ControlID_Label = GUICtrlCreateLabel("ControlID:",5,32,290,24) Global $X_Coord_Label = GUICtrlCreateLabel("X:",5,59,290,24) Global $Y_Coord_Label = GUICtrlCreateLabel("Y:",5,86,290,24) GUISetState(@SW_SHOW) While 1 Sleep(100) Local $Cursor_Info_Array = GUIGetCursorInfo("[active]") Local $Active_Window_Title = WinGetTitle("[active]") GUICtrlSetData($Window_Label, "Active Window: " & $Active_Window_Title) GUICtrlSetData($ControlID_Label, "ControlID: " & $Cursor_Info_Array[4]) GUICtrlSetData($X_Coord_Label, "X: " & $Cursor_Info_Array[0]) GUICtrlSetData($Y_Coord_Label, "Y: " & $Cursor_Info_Array[1]) WEnd Func Decoder_Events() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE Exit Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE Case @GUI_CtrlId = $GUI_EVENT_RESTORE EndSelect EndFunc If I comment out the CUICtrlSetData lines which contain $Cursor_Info_Array, the program does not crash. Scite doesn't seem to find any errors. Any ideas what I did wrong?
  14. Greetings, I am trying to take emails sitting in my outbox (from MailMerge) and apply High Importance to them before they are sent. I thought I could get it to work with something like: _OL_ItemModify($Outlook_Connection, $Email_In_Focus, Default, $iImportance=$olImportanceHigh) But, this strategy does not appear to work. Any recommendations on how to apply High Importance to an email in my outbox? _____________________________________________________________________________________________________________________ Edit: I fixed it with: _OL_ItemModify($Outlook_Connection, $Email_In_Focus, Default, "Importance=" & $olImportanceHigh)
  15. I had never delved deeply enough into AutoIT (or any other language for that matter) to come across such things. What a fascinating rabbit-hole! Thank you for pointing me in such a direction. In case this has inspired anyone else to put on a little blue dress: https://www.autoitscript.com/autoit3/docs/intro/ComRef.htm
  16. Now there's an idea! I compiled it using the 64-bit Aut2Exe (because I don't know how to do that directly from Scite), and it did not give me the error. It's sitting here occupying 1,805 MB of ram. I'm a little curious what would make it happy to hold the data using 1.8GB in 64-bit while it gave me the 2-GB error in 32-bit.
  17. Great question. Each CSV line is formatted: Wholesaler,Retailer,Product_Category,Model_Number,Sale_Date,Transaction_Date I am trying to build something that will tell me about each retailer's orders. I do not believe the sum of data for any individual retailer would encounter the memory cap, so there is probably some merit to the idea that I could read line by line to create an array for each retailer. I set up a test for that last night to see the speed at which it might process using something like this: Global $Lines_Of_Data_In_The_CSV = _FileCountLines("C:\Folder\Data.csv") Global $Sales_Data_Dump_CSV = FileOpen("C:\Folder\Data.csv", $FO_READ) Global $New_Array[$Lines_Of_Data_In_The_CSV] Global $GUI_Reading = GUICtrlCreateLabel($Lines_Of_Data_In_The_CSV,5,5,500,30) For $i = 1 to $Lines_Of_Data_In_The_CSV $New_Array[$i] = FileReadLine($Sales_Data_Dump_CSV,$i) GUICtrlSetData($GUI_Reading, $i & " " & $New_Array[$i]) Next In almost a full day, it's only about 10% of the way through the file. That is concerningly slow. Though, it is still better than doing it by hand.
  18. Hello, I am trying to manipulate a large CSV file (Over 5 million lines with 50-300 characters per line). I thought I would start with something like: _FileReadToArray("C:\Folder\Data.csv", $My_Data_Array) But, I get a popup "Error allocating memory." as soon as I hit 2GB of RAM usage. Does anyone have a good way to approach such a task?
  19. I solved all my issues by studying the sample files you included with the thing. I should have read everything before asking a question. What I ended up with was essentially this: Global $Outlook_Connection = _OL_Open() Global $Outlook_Outbox = _OL_FolderAccess($Outlook_Connection, "", $olFolderOutbox) Global $Emails_In_Outlook_Outbox = _OL_ItemFind($Outlook_Connection, $Outlook_Outbox[1], $olMail, "", "", "", "EntryID") For $iIndex = 1 To $Emails_In_Outlook_Outbox[0][0] $Email_In_Focus = $Outlook_Connection.Session.GetItemFromID($Emails_In_Outlook_Outbox[$iIndex][0]) _OL_ItemRecipientAdd($Outlook_Connection, $Email_In_Focus, Default, $olBCC, $BCC_Address) _OL_ItemAttachmentAdd($Outlook_Connection, $Email_In_Focus, Default, $Email_Attachment) Next I very much appreciate you making this UDF. This is going to save me upwards of an hour per week.
  20. It appears my current hurdle is _OL_FolderAccess giving the error "Error accessing Outbox. @error = 4, @extended = 1" when I try to run this: Func Update_Outbox() Global $oOL = _OL_Open() Global $Outlook_Outbox = _OL_FolderAccess($oOL, $olFolderOutbox) Which means it can't find $olFolderOutbox. I thought that part would work because I found $olFolderOutbox in OutlookEX_Base.au3 (which I included in the script). Any idea why it can't find the outbox?
  21. OMMA gave me the idea for this, but neither of those options allow adding a BCC email. Work requires I log the emails I send by BCCing an email address. I am trying to automate both the attachments and the BCCing.
  22. Good morning, At work, I frequently use Microsoft Word's Mail Merge (which does not support BCC or attachments) to send emails to a couple hundred people. I aim to use this wonderful UDF to add a BCC email and attachments to these emails. I can get the emails to sit in my outbox by setting Outlook to Work Offline, so I'm trying to put something together that will loop through all the emails in my outbox and give each a BCC address and selected attachments. Below is what I have so far, but I'm not clever enough today to fix the Update_Outbox() function, and I was hoping someone in here was willing to help. I have outlined what I think I should try to do. AutoItSetOption("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $BCC_Address Global $Email_Attachment #include <Array.au3> #include <MsgBoxConstants.au3> #include <GUIConstants.au3> #include <OutlookEx_Base.au3> #include <OutlookEx.au3> #Region ;GUI Global $Email_Helper_GUI = GUICreate("", 311, 58) GUISetBkColor(0xCCCCCC) GUISetFont(14) GUISetOnEvent($GUI_EVENT_CLOSE, "Email_Helper_Events") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Email_Helper_Events") GUISetOnEvent($GUI_EVENT_RESTORE, "Email_Helper_Events") Global $GUI_Label_BCC = GUICtrlCreateLabel("BCC email:",5,5,90,22) Global $BCC_Address_Field = GUICtrlCreateInput("",100,5,206,22) GUICtrlSetFont(-1,12) Global $GUI_Select_Attachment_Button = GUICtrlCreateButton("Select Attachment",3,30,150,24) GUICtrlSetFont(-1,12) GUICtrlSetOnEvent(-1,"Select_Attachment") Global $GUI_Update_Outbox_Button = GUICtrlCreateButton("Update Outbox",158,30,150,24) GUICtrlSetFont(-1,12) GUICtrlSetOnEvent(-1, "Update_Outbox") GUISetState(@SW_SHOW, $Email_Helper_GUI) #EndRegion While 1 Sleep(10) WEnd Func Email_Helper_Events() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE Exit Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE Case @GUI_CtrlId = $GUI_EVENT_RESTORE EndSelect EndFunc Func Select_Attachment() $Email_Attachment = FileOpenDialog("Select Attachment", @MyDocumentsDir,"All (*.*)", BitOR($FD_FILEMUSTEXIST, $FD_MULTISELECT)) If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No file(s) were selected.") FileChangeDir(@ScriptDir) Else FileChangeDir(@ScriptDir) MsgBox($MB_SYSTEMMODAL, "", "You chose the following file(s):" & @CRLF & $Email_Attachment) EndIf EndFunc Func Update_Outbox() $BCC_Address = GUICtrlRead($BCC_Address_Field) Global $oOL = _OL_Open() ; Connect to Outlook Global $Outlook_Outbox = _OL_FolderAccess($oOL, $olFolderOutbox) ; Access the Outbox ;~ For ???? to ???? ;~ ????????????? = _OL_ItemRecipientAdd($oOutlook, $Each_Email_In_Outbox, Default, $olBCC, $BCC_Address) ;~ ????????????? = _OL_ItemAttachmentAdd($oOutlook, $Each_Email_In_Outbox, Default, $Email_Attachment) ;~ Next ;~ MsgBox(1,"OutBox Update Complete", "The OutBox has been updated.") ;~ _OL_Close($oOutlook) EndFunc I appreciate any guidance. Thank you.
  23. Greetings, My job often requires me to use Microsoft Outlook to send the same email to a long list of addresses while BCCing a different address for recordkeeping. It takes a long time to do this manually, and I'd like to automate it. Microsoft Word's Mail Merge seemed like a clear choice for sending the emails as it lets me send the same email to a list of addresses contained in an Excel spreadsheet, but it does not appear to allow BCCing. I was hopeful that I could set up a rule for Outlook that would automatically BCC, but it only appears to offer CC (not BCC). I've been poking through the OutlookEX UDF because I figured I could loop through the addresses and BCC without issue. Try as I can, I seem unable to use this UDF to send an email I've constructed in Outlook. I can send messages typed into a GUICtrlCreateInput, but I can't seem to figure out a way to send a premade email with embedded pictures and the like. The closest I managed to get was emailing C:\Location\Of\The\File\On\My\Drive.msg. Do any of you see a clean way to do this?
  24. Hello. I'd be very appreciative if someone could help me figure out how to use Autoit to change my availability (Available, Away, Busy, Do Not Disturb, Offline) in Microsoft Teams. I came up empty trying to find a way to do it.
  25. Any idea how to use this on something other than my microphone input? i.e. turn an mp3 into text, or have the incoming sound from a phone call be converted into text
×
×
  • Create New...