-
Posts
919 -
Joined
-
Last visited
-
Days Won
8
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by Jfish
-
Script made on Win 11, doesn't work on Win 10
Jfish replied to Newb's topic in AutoIt General Help and Support
When you installed the full version did you upgrade to a newer version of Autoit? If so, you may have picked up important updates that un-broke your script. It wouldn't be uncommon to need to update scripts for compatibility and distribution when there are OS changes. -
I don't want to pimp my own book, but you can download it here and it has pretty good material for someone starting out:
-
Why not just loop through the array to get the values you want and return them with whatever type suits you?
-
[this was a reply to a message that was subsequently deleted - won't let me delete the reply for some reason] Yes. it can code and it can also debug code. It isn't always 100% accurate but over time it has the potential to radically change so many things - including software development.
-
PDF to TEXT conversion -- foxit reader automation
Jfish replied to rudi's topic in AutoIt General Help and Support
@rudi - I was digging around a bit, I think it may have a dependency on the paid Foxit SDK. It appears you can get a free trial on their site but then you need to pay after the trial. So not sure if this is a work thing ... if so may still be worth investigating. Then (untested) something like this: Dim foxitApp As Object Set foxitApp = CreateObject("FoxitReader.SDK.CommonUIAutomation") -
PDF to TEXT conversion -- foxit reader automation
Jfish replied to rudi's topic in AutoIt General Help and Support
I have not tested this (I don't have Foxit), but I was curious what Chat GPT-4 would say when asked about possible solutions to best automate reader. I asked it specifically about using a COM API (Foxit does have an API). It barfed up the following tester which may or may not work. Either way, the API reference docs can be found here. I would think the API would be more reliable then sending commands to the GUI. ; Create a FoxitReader COM object $foxit = ObjCreate("FoxitReader.Application") ; Open a PDF file $doc = $foxit.Open("C:\example.pdf") ; Set the zoom level to 100% $viewer = $doc.GetViewer() $viewer.Zoom = 100 ; Save the document $doc.Save() ; Close the document and quit Foxit $doc.Close() $foxit.Quit() -
CHAT GPT is taking over ... so I asked it to help me code a call to itself from AutoIt. It did pretty well - but ultimately I had to turn to the docs to realize that it was calling its own deprecated endpoint that I needed to update (AI has limits I guess). Anywho, if anyone wants to play around with it here is a working example: #include <WinHttp.au3> #include <Json.au3> ; Set up WinHttp object $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHttp.Open("POST", "https://api.openai.com/v1/completions", false) $oHttp.SetRequestHeader("Content-Type", "application/json") $oHttp.SetRequestHeader("Authorization", "Bearer <YOUR API KEY HERE>"); you will need to get an API key and place it here ; Set up request data params can be seen here https://platform.openai.com/docs/api-reference/completions/create ; tokens dictate length $sData = '{"model": "text-davinci-003", "prompt": "what day is it?", "max_tokens": 10}' ; change the prompt to whatever you want ; Send request and get response $oHttp.Send($sData) ; Check if request was successful If $oHttp.Status <> 200 Then MsgBox(0, "Error", "WinHttp request failed with status code: " & $oHttp.Status) Exit EndIf $sResponse = $oHttp.ResponseText ; Parse response and display $aJson = _Json_Parse($sResponse) $sText = $aJson.choices[0].text MsgBox(0, "Response", $sText)
-
Comparing ClipGet value from Excel
Jfish replied to Uemlue's topic in AutoIt General Help and Support
@Uemlue my book has a chapter on automating other applications and covers some of the basics for the Excel UDF (link below). There is also excellent wiki coverage here: https://www.autoitscript.com/wiki/Excel_UDF -
Not sure why this is an autoit question or why you are not using OpenSSL to decrypt but see these examples: https://stackoverflow.com/questions/16056135/how-to-use-openssl-to-encrypt-decrypt-files
-
Comparing ClipGet value from Excel
Jfish replied to Uemlue's topic in AutoIt General Help and Support
I recommend the excel UDF functions to read the value from excel for your compare instead of sending ctrl+c for a generic copy. -
Can I send a click by Class and Instances ?
Jfish replied to SeanGozlan's topic in AutoIt General Help and Support
What application are you trying to automate? Lots of questions in your post but the coordinates within a given control are relative to the control when you use ControlClick (as opposed to MouseClick). ControlClick has optional X,Y parameters that allow for clicking on a specific spot in the control. If you are intending to interact with a WPF control under Windows 10 it may not work with these methods as it may require UI Automation (see below post). -
Trouble getting battery info for laptop
Jfish replied to PeterlFF's topic in AutoIt General Help and Support
I haven't tested the code but out of pure curiosity - is your laptop plugged in when you run the code (if so, consider unplugging)? Also, confirming you are not using an emulator? "When debugging on a device emulator, the BatteryReport object returns null to the capacity and rate properties." -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
You should test on another machine but as previously mentioned, the coordinates for the controlclick function are relative to the control as compared to mousemove that is relative to the screen. We seem to be just repeating the same info at this point so I am going to wish you the best with the project. -
Trouble getting battery info for laptop
Jfish replied to PeterlFF's topic in AutoIt General Help and Support
In reading the notes on Win32_battery it says the design capacity property is the capacity expressed in milliwatt-hours. Trying to understand why that is not what you are after from reading your post? -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
Didn't it work on your machine / monitor when you ran the code? You said "I don't know why, but your code works as I wanted." Did you have to adjust anything to make it work? I already answered the other thread you posted (please keep posts/threads separate) you should try the approach I linked. -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
Because I adjusted X. We are not using MouseMove which you have referenced a couple of times in the code. We are using parameters as part of the ControlClick function that tell the code where to click within the targeted control. X is one of those parameters. Not sure what you are seeing about the mouse moving outside the control, I don't see that. If your code has MouseMove then that could cause that issue because it is not relative to the control per se, rather to the screen. -
ControlClick function not working on Calculator
Jfish replied to inna's topic in AutoIt General Help and Support
Calculator's buttons can't be identified in that manner any longer because they moved to WPF in Windows 10. So you need to understand the applications that you are trying to automate and which technology can be used to identify the controls to interact with them. In the example of Calculator - UIAutomation should work. It should also work on other applications. -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
when you run the code I posted you should see this as output: This is This is text and i is $i2text and i is $i1 It is selecting "some" and replacing it with a carriage return. Of course, you can also solve this problem by editing the text before you send it to Notepad, -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
try the code in my edited post, yours works that way too but you are highlighting / selecting the very last text on the line instead of "some" because your X value is off -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
Double clicking the word in Notepad only selects it. Then when you send enter you are basically erasing that word and replacing it with a carriage return which moves everything after that to the next line (while preserving everything before it on the line which had the selected word). EDIT: and it does remove that word when it is replaced with the carriage return if that is the problem you are trying to solve. Change the value of x to 100 and run the code. Here it is with a sleep so you can see what is happening: Run('notepad.exe') WinWaitActive("Notepad", '', '1') Local $x = 100; position is 'some' Local $y = 142 ; position is 'some' Local $i = 1 While $i <= 2 Send('This is some text and i is $i' & $i) ControlClick('[Class:Notepad]', '', '', 'left', '2', $x, $y) sleep(1000) $i = $i + 1 Send('{ENTER}') WEnd MouseMove($x, $y) -
ControlClick clicking the correct position
Jfish replied to inna's topic in AutoIt General Help and Support
Not sure I follow you 100% but it goes to the next line because you are sending the enter key to Notepad -
ControlClick function not working on Calculator
Jfish replied to inna's topic in AutoIt General Help and Support
I believe they changed calculator in Win 10. I think you need to use UIAutomation now: -
Dragging a mouse exact distance back and forth
Jfish replied to kewlak's topic in AutoIt General Help and Support
I am not sure as the nature of what you are trying to do - my response assumes you read the forum rules. That said, look at MouseMove with MouseDown and MouseUp. I would also encourage you to code something and post the code as that usually tends to attract the most help. -
Check the "extras" folder in your autoit directory for editor plugins.
-
How do i press on Login Button
Jfish replied to Pavan_singh's topic in AutoIt General Help and Support
If thick client have you tried Au3Info to identify the login button info? (and / or IUAutomation) )