Jump to content

computergroove

Active Members
  • Posts

    1,005
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

computergroove's Achievements

  1. Func _importPhoneNumbers() $s_file = FileOpenDialog("Select a file",@ScriptDir & "\","All Files (*.*)") If @error Then MsgBox(4096,"","No File(s) chosen or bad filter") Else MsgBox(0,"Title",$s_file) Exit EndIf EndFunc Looks like this places the file location in the value of $s_file. Now I just need to make the rules for parsing the data.
  2. Friend of mine has a website where he sells products. He has a customer base that has ordered from him in the past and he wants a text messaging program / script to send promotional messages to people that have already purchased his products. He has their names and phone numbers in an excel document. I have made a simple GUI with GUI Builder + and I have made a button that opens a file browser to select the csv file but I don't know the code to save the file or file path as a variable that I can then use it to check for the right number of characters and make sure there are no illegal characters etc. I am trying to use google voice to send the messages with sendgvsms.au3 which I believe needs to be tweaked because google made some changes when they discontinued hangouts because there was an au3 file in the example scripts that utilizes it. Is there a better more current way to do this? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <_sendGVSMS.au3> #include <File.au3> #Region (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===) Global $hGUI = GUICreate("Batch Text Messager", 824, 635, 1024, 545) Global $Message = GUICtrlCreateInput("0", 20, 366, 781, 140) GUICtrlCreateUpdown(-1) GUICtrlSetFont(-1, 16) Global $Label_1 = GUICtrlCreateLabel("Message Text", 30, 323, 151, 31) GUICtrlSetFont(-1, 16) Global $Imported_Phone_Numbers = GUICtrlCreateInput("Phone Numbers", 460, 60, 341, 270) GUICtrlCreateUpdown(-1) GUICtrlSetFont(-1, 16) Global $ImportPhoneNumbers = GUICtrlCreateButton("Import Phone Numbers", 100, 110, 211, 31) Global $Label_2 = GUICtrlCreateLabel("Click on the Import Phone Numbers button. Phone numbers must be in CSV format.", 10, 40, 401, 51) GUICtrlSetFont(-1, 16) Global $Label_3 = GUICtrlCreateLabel("Imported Phone Numbers", 480, 20, 251, 31) GUICtrlSetFont(-1, 16) Global $SendToAll = GUICtrlCreateButton("Send To All", 610, 525, 171, 31) Global $Exit = GUICtrlCreateButton("Exit", 610, 580, 171, 31) #EndRegion (=== GUI generated by GuiBuilderPlus 1.0.0-beta4 ===) _main() ;------------------------------------------------------------------------------ ; Title...........: _main ; Description.....: run the main program loop ;------------------------------------------------------------------------------ Func _main() GUISetState(@SW_SHOWNORMAL) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $ImportPhoneNumbers _importPhoneNumbers() Case $SendToAll _sendMessages() Case $Exit Terminate() EndSwitch WEnd EndFunc ;==>_main Func _importPhoneNumbers() Run("C:\WINDOWS\EXPLORER.EXE") EndFunc Func _sendMessages() MsgBox(0,"title","message 2") EndFunc Func Terminate() Exit 0 EndFunc
  3. I'm in the middle of writing a function but this looks like it might work, Ill report back. Thanks
  4. I want to make a script that can cycle through part of or the whole year (ie. 1-1-19 through 1-31-19 then cycle to 2-1 etc) I want to specify the starting date, add some data and export the information to a text file. Is there a function that I can call that will do this? I am thinking I can just use the number of the day (IE day 32 = feb 1). Any suggestions?
  5. This is part of it. When I run what you made I get what I am looking for with the new elements but if I go over the length of the screen then the screen wont give me any way to scroll. Can this be done?
  6. Try this: ShellExecute ( "Food.pdf" , "" ,"C:\My Files\","print" ) You may need to elevate to admin depending on what version of Windows you are running.
  7. I've made a form in Koda where I make a list of 3 user definable elements that I want to be able to replicate with a button press so a user can add data that can be used as part of the program. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=D:\Carbonite Important\0 - Programing\Scite and Autoit\Koda 1.7.3.0\Forms\Mileage Estimator.kxf $Form1 = GUICreate("Save Project", 614, 1126, 298, 141) $Location = GUICtrlCreateInput("Location", 40, 112, 345, 21) $Distance = GUICtrlCreateInput("Distance", 400, 112, 89, 21) $AddLocation = GUICtrlCreateButton("AddLocation", 288, 80, 97, 25) $Label1 = GUICtrlCreateLabel("Location", 40, 88, 45, 17) $Label2 = GUICtrlCreateLabel("Distance", 400, 88, 46, 17) $HomeBase = GUICtrlCreateInput("HomeBase", 312, 32, 121, 21) $LeapYear = GUICtrlCreateCheckbox("LeapYear", 464, 32, 17, 17) $Label3 = GUICtrlCreateLabel("Leap Year?", 488, 32, 59, 17) $Variance = GUICtrlCreateInput("Variance", 504, 112, 81, 21) $Label4 = GUICtrlCreateLabel("Variance", 504, 88, 46, 17) $Label5 = GUICtrlCreateLabel("Home Base", 312, 8, 59, 17) $Button1 = GUICtrlCreateButton("Button1", 144, 56, 1, 57) $Save = GUICtrlCreateButton("Save Project", 40, 16, 121, 25) $Load = GUICtrlCreateButton("Load Project", 176, 16, 121, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Form1 Case $AddLocation EndSwitch WEnd I want to press the "add location" button and have the fields {Location, Distance and variance} create a new blank record located under the existing 3 input boxes. Since the fields can number over 30 locations in some examples I am thinking about having these items in a scrolling window. What is the best way to do this and can auto it add a variable while running by pressing a button?
  8. That worked. Here it is the imagesearch.au3 modified code that worked. #include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Image Search ; Require that the ImageSearchDLL.dll be loadable ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Description: Find the position of an image on the desktop ; Syntax: _ImageSearchArea, _ImageSearch ; Parameter(s): ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify ; a desktop region to search ; ;=============================================================================== Func _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $HBMP=0) return _ImageSearchArea($findImage,$resultPosition,0,0,@DesktopWidth,@DesktopHeight,$x,$y,$tolerance,$HBMP) EndFunc Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance, $HBMP=0) ;MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if $tolerance>0 then $findImage = "*" & $tolerance & " " & $findImage If IsString($findImage) Then $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage,"ptr",$HBMP) Else $result = DllCall("ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"ptr",$findImage,"ptr",$HBMP) EndIf ; If error exit if $result[0]="0" then return 0 ; Otherwise get the x,y location of the match and the size of the image to ; compute the centre of search $array = StringSplit($result[0],"|") $x=Int(Number($array[2])) $y=Int(Number($array[3])) if $resultPosition=1 then $x=$x + Int(Number($array[4])/2) $y=$y + Int(Number($array[5])/2) endif return 1 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for an image to appear ; ; Syntax: _WaitForImageSearch, _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the image to locate on the desktop ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImageSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $HBMP=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs sleep(100) $result=_ImageSearch($findImage,$resultPosition,$x, $y,$tolerance,$HBMP) if $result > 0 Then return 1 EndIf WEnd return 0 EndFunc ;=============================================================================== ; ; Description: Wait for a specified number of seconds for any of a set of ; images to appear ; ; Syntax: _WaitForImagesSearch ; Parameter(s): ; $waitSecs - seconds to try and find the image ; $findImage - the ARRAY of images to locate on the desktop ; - ARRAY[0] is set to the number of images to loop through ; ARRAY[1] is the first image ; $tolerance - 0 for no tolerance (0-255). Needed when colors of ; image differ from desktop. e.g GIF ; $resultPosition - Set where the returned x,y location of the image is. ; 1 for centre of image, 0 for top left of image ; $x $y - Return the x and y location of the image ; ; Return Value(s): On Success - Returns the index of the successful find ; On Failure - Returns 0 ; ; ;=============================================================================== Func _WaitForImagesSearch($findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance, $HBMP=0) $waitSecs = $waitSecs * 1000 $startTime=TimerInit() While TimerDiff($startTime) < $waitSecs for $i = 1 to $findImage[0] sleep(100) $result=_ImageSearch($findImage[$i],$resultPosition,$x, $y,$tolerance,$HBMP) if $result > 0 Then return $i EndIf Next WEnd return 0 EndFunc
  9. I got this to work by making a .bat file and adding it to the shell:startup folder. It works now. No idea why this is necessary.
  10. I am trying to integrate imagesearch into a script I am making. When I try to compile the script I get the following inside imagesearch.au3 under all 4 of the imagesearch.au3 defined functions: "Error: Missing separator character before keyword" I tried the beta version of Autoit and it is doing the same thing. I am using the x32 version of the imagesearch.au3 found here - https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiUmsrEsLzPAhWs7YMKHS9MClQQFggfMAA&url=https%3A%2F%2Fwww.autoitscript.com%2Fforum%2Ftopic%2F148005-imagesearch-usage-explanation%2F&usg=AFQjCNFwpFnZMxVK9H4cDASRnjiB-65gOw&bvm=bv.134495766,d.amc I have put the imagesearchDLL.dll in both the includes directory and the system32 directory. I am using x64 Windows 8.1 Pro. I cant see anything wrong. Please help.
  11. I can start my script's compiled exe by double clicking it. I can see the autoit's default tray icon opening in the taskbar next to the time. When I restart the computer the icon does not show up nor does the actions the script is supposed to do occur. Are you saying it is not possible to do this in windows 8? Just upgrade to windows 10 and this will work?
  12. I am trying to start my script on Windows startup and it doesn't run. I have disabled defender and smartscreen with no luck. There is no antivirus on this machine. I have added the script to shell:startup, shell:common startup and HKLM\Software\Microsoft\Windows\Current Version\Run all with no luck. Im at a loss. Please help.
  13. If I cant do it as a pdf because of autoit limitations then can I force a 40 column format with centering left and right justification in a text file or something else?
  14. The printer has a paper width of 3 1/8" as I said in the original description of the problem. Receipt printers will just cut off incorrectly formatted text instead of word wrapping it. The reason I need to change data is that I have a customizable coupon form that prints for the customer based on what was purchased. Its a rewards program of sorts and I pre made a pdf file formatted to the right printing width. Imagine this: Super Food Market 1212 Main st Kalamazoo, MI 12345 616-123-4567 You have earned [Reward total] to be used on your next purchase at super food market as a template that I would replace [reward total] with a number read from another file on the POS Server. The individual dealers at the stores that would want to use this rewards program always want to customize the form. I can let them do that with a pdf file if they keep the right tags in the pdf file. Thats what Im trying to do.
  15. I have a receipt printer that has 3 1/8" wide thermal paper in it. I need to print a custom receipt for a customer based on some information gathered real time from a file generated by their POS. I've come to the conclusion that a formatted pdf file is the best way to do this because of the custom paper size. I have seen examples of where a pdf file can be opened and read but can I change text data in a pdf file? I am making the pdf file so I can edit however it needs to be for this project.
×
×
  • Create New...