Jump to content

Need some help with automation

neeedmoredeeps

So i'm trying to do some automation with a project.

 

Basically i/m trying to capture screen shots from a microscope automatically about 2600 times a lot.  using a macro and it works but i'm limited to 250 in it and i need to have it run 2600 times.

 

Basically i'm using a hdmi capture card.

 

Alt tab ti switch from the Microscope control to the video

Windows Print screen to take a screen shot

Alt tab back to Microscope control

, to advance to next position

 

 

Could Auto hotkey help me out? Any better solution for this this?

 

 

Thanks for the help. I know this is a dumb question but i hit a wall on this.

 

Link to comment
Share on other sites

Link to post
Share on other sites

59 minutes ago, neeedmoredeeps said:

So i'm trying to do some automation with a project.

 

Basically i/m trying to capture screen shots from a microscope automatically about 2600 times a lot.  using a macro and it works but i'm limited to 250 in it and i need to have it run 2600 times.

 

Basically i'm using a hdmi capture card.

 

Alt tab ti switch from the Microscope control to the video

Windows Print screen to take a screen shot

Alt tab back to Microscope control

, to advance to next position

 

 

Could Auto hotkey help me out? Any better solution for this this?

 

 

Thanks for the help. I know this is a dumb question but i hit a wall on this.

 

It's not a dumb question, everyone starts somewhere in their pursuit of knowledge.

 

Yes, auto hotkey would work...I personally use autoIT (more familiar with it)

 

I'm curious though, you have a macro that is capable of doing it 250 times?  What is the macro currently written in?  [Sometimes it's better to use what you have but just modify it...sometimes].

 

When you say you are using an hdmi capture card...are you essentially running something like recentral in the background and looking at the live stream?  If so, there might be a better way than using Windows Print Screen to take a screenshot...with an example being calling ffmpeg to capture the input from the HDMI source (and putting it to an jpg or bmp).

 

Either way, here is a rough auto-it script (I don't have auto-it on my computer, so this is just me writing the general concept)...not ideal solution at all, but sometimes it's about making things work quickly rather than making them look pretty and well designed :p

#include <ScreenCapture.au3>
#include<Date.au3>

Send("{ALT DOWN}") ; Effectively part one of alt-tab 
Send("{TAB}") ; Actually in theory there are better ways to open the windows you need...
				;but it involves me having more knowledge of the programs you are using
Send("{ALT UP}")

printscreen()

Send("{ALT DOWN}") ; Second press of alt tab
Send("{TAB}")
Send("{ALT UP}")

; Uhm how do you advance to next position?  If it's a button and always in the same position you could get the program to click.  If you can trigger the next position with a command like ctrl-n then you can easily send a key...but would need more info

Func printscreen() ; From https://www.autoitscript.com/forum/topic/177719-solved-how-would-i-save-a-print-screen-to-a-file-with-the-current-date/
$FilePath =(@DesktopDir&"/")
$FileName = 'Vv'
$FileList = _FileListToArray($FilePath, $FileName & '*.jpg', 1)

If Not IsArray($FileList) Then
    $FileName&= '1.jpg'
Else
        $FileName &= $FileList[0] + 1 & '.jpg'
EndIf
_ScreenCapture_Capture($FilePath & "\" & $FileName)
EndFunc

 

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

Thanks. I'm just using a game pad's macro software right now lol.  Set this up as a proof of concept and now working on getting a final version worked out so I can start taking pictures of known good parts but need to run it in lots of 2600.    

 

 

 

I'm going to look into autoit. Thanks. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×