Hello everyone,
I want to take screenshot of a specific area of my screen and save it somewhere, then I want to upload it on any website with a FileDialog.
1. Which is the best method to do the first step? Can I take a screenshot of a specific area and directly save it somewhere in autohotkey? Also delete it after uploading it?
2. Is it possible to control the OpenFileDialog without ImageSearch in AHK? Like navigating where I saved the screenshot and select it etc.
I'm asking a way without methods like ImageSearch because I want to run the script on many other PC's, so wouldn't it be safer if we click on objects (like a button in OFD) rather than ImageSearch since it wouldn't fit when the resolution changes?
I wanted to automate the website part with selenium or Rufaydium, which one is better? Since you guys have experience with both. I would like to know what professional coders think of those. Or another web automation library?
Thanks in advance
Take screenshot and upload the same screenshot | OpenFileDialog Control
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
I use this modified version of ScreenClipper by Learning One.
It saves screenshot on D:/temp and uses Datetime to name it: dd_mm_yyyy__hh_mm_ss
It also copy the new filename to the Clipboard, so, if you already have a FileDialog, you can just paste on it (Filename TextBox, or EditBox not sure how you call it).
I really don't understand what "FileDialog" you have. I mean, a FileDialog is part of Windows and some application just call it when you want to save or load from a file. So it relay on the application you are using. Most time Ctrl + O call Open File Dialog and maybe CTRL + S or CTRL + G call Save File Dialog; maybe you can Send those Shortcut from AutoHotkey to the active window.
If you already have a website to upload it, you can use: Run, www.theweb.com
It saves screenshot on D:/temp and uses Datetime to name it: dd_mm_yyyy__hh_mm_ss
It also copy the new filename to the Clipboard, so, if you already have a FileDialog, you can just paste on it (Filename TextBox, or EditBox not sure how you call it).
I really don't understand what "FileDialog" you have. I mean, a FileDialog is part of Windows and some application just call it when you want to save or load from a file. So it relay on the application you are using. Most time Ctrl + O call Open File Dialog and maybe CTRL + S or CTRL + G call Save File Dialog; maybe you can Send those Shortcut from AutoHotkey to the active window.
If you already have a website to upload it, you can use: Run, www.theweb.com
- Attachments
-
- ScreenClipper.ahk
- (87.79 KiB) Downloaded 35 times
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
Thanks for your answer.Lepes wrote: ↑09 Jun 2022, 01:05I use this modified version of ScreenClipper by Learning One.
It saves screenshot on D:/temp and uses Datetime to name it: dd_mm_yyyy__hh_mm_ss
It also copy the new filename to the Clipboard, so, if you already have a FileDialog, you can just paste on it (Filename TextBox, or EditBox not sure how you call it).
I really don't understand what "FileDialog" you have. I mean, a FileDialog is part of Windows and some application just call it when you want to save or load from a file. So it relay on the application you are using. Most time Ctrl + O call Open File Dialog and maybe CTRL + S or CTRL + G call Save File Dialog; maybe you can Send those Shortcut from AutoHotkey to the active window.
If you already have a website to upload it, you can use: Run, www.theweb.com
Although I'm not searching an advanced Screenshot tool, I can take the screenshot with LightShot or any similar light-weight tool.
I also want to automate all the stuff. So the question is, can find and press a button or a text field in an OpenFileDialog (Windows standard) and press it.
Like here;
https://prnt.sc/-7HQZkO_NK6r
You see that the name of the button is Button1, can I find it also within AHK ? If yes, how do I find the ClassNN Object?
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
What's the web service link you wanna upload the file to?
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
@newbie007 - You can detect that pages Upload-Button ("Wähle Bilder aus") using UIAViewer.exe or AccViewer.exe (where btw, that button has the acc-path '4.1.1.2.2.2.4.1.1.1.1.1' (Chrome Version 102.0.5005.62 (Official Build - 64-Bit)). Once OpenFileDialog opens you can enter the full path of your screenshot/image to its filename/Dateiname-field (that should have the focus already). That will simply overwrite the Dialogs preset/default filepath, without forcing you to meander through a directory tree beforehand. HTH, good luck
Edit: meanwhile UIAViewer can detect acc-paths! As explained here: viewtopic.php?p=467030#p467030
Well, as its developer mentioned explicitly: "... but I think I don't want to work with legacy code anymore (Oleacc/MSAA is not actively being developed anymore, but UIA is)". So, going with UIA is preferable.
Edit: meanwhile UIAViewer can detect acc-paths! As explained here: viewtopic.php?p=467030#p467030
Well, as its developer mentioned explicitly: "... but I think I don't want to work with legacy code anymore (Oleacc/MSAA is not actively being developed anymore, but UIA is)". So, going with UIA is preferable.
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
I read that but what do you guys mean with "Acc"? I'm not that advancedBoBo wrote: ↑09 Jun 2022, 03:20@newbie007 - You can detect that pages Upload-Button ("Wähle Bilder aus") using UIAViewer.exe or AccViewer.exe (where btw, that button has the acc-path '4.1.1.2.2.2.4.1.1.1.1.1' (Chrome Version 102.0.5005.62 (Official Build - 64-Bit)). Once OpenFileDialog opens you can enter the full path of your screenshot/image to its filename/Dateiname-field (that should have the focus already). That will simply overwrite the Dialogs preset/default file path, without forcing you to meander through a directory tree beforehand. HTH, good luck
Edit: meanwhile UIAViewer can detect acc-paths! As explained here: viewtopic.php?p=467030#p467030
Well, as its developer mentioned explicitly: "... but I think I don't want to work with legacy code anymore (Oleacc/MSAA is not actively being developed anymore, but UIA is)".
So, going with UIA is preferable.
Re: Take screenshot and upload the same screenshot | OpenFileDialog Control
See Microsoft Active Accessibility (MSAA). That interface allows for accessing text associated with controls that otherwise wouldn’t be available. An AHK library supporting MSAA was posted here.
Who is online
Users browsing this forum: Google [Bot], Yahoo [Bot] and 109 guests