Jump to content
Sign in to follow this  
careca

Get file path on left click?

Recommended Posts

careca

Hi guys, the objective here is to left click on an image, and get its path, then it should retrieve its resolution, but i've got that part covered, problem now is really the part of getting autoit to recognize that i clicked on something, and getting that object path..

#include "image_get_info.au3"
Global $file, $aInfo
$file = FileOpenDialog("Please select file", "", "Image files (*.jpg;*.tif;*.gif;*.bmp;*.png)")
$aInfo = _ImageGetInfo($file)
TrayTip("Resolution", _ImageGetParam($aInfo, "") & "x" & _ImageGetParam($aInfo, ""), 3, 1)

So i was thinking about removing FileOpenDialog for something that doesn't need user input..

#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
If _IsPressed("01", $hDLL) Then
Retrieve path, and use the path on the above code.

Greetings.

EDIT: Final Code with the sugestions implemented.

Changes done: now works with space+left mouse click, displays a traytip, balloon-like with the image resolution, if can be read.

#include "image_get_info.au3"
#include <Misc.au3>
AutoItSetOption("TrayAutoPause", 0)
Local $hDLL = DllOpen("user32.dll")
Local $file, $aInfo

While 1
If _IsPressed("20", $hDLL) And _IsPressed("01", $hDLL) Then
Sleep(50)
Send("^c")
Sleep(50)
$file = ClipGet()
;MsgBox(0, "1", $file)
$aInfo = _ImageGetInfo($file)
;MsgBox(0, "2", $aInfo)
TrayTip("Resolution", _ImageGetParam($aInfo, "Width") & "x" & _ImageGetParam($aInfo, "Height"), 3, 1)
EndIf
WEnd

Thanks guys.

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
careca

#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")

While 1
If _IsPressed("11", $hDLL) And _IsPressed("01", $hDLL) Then
Sleep(100)
Send("^c")
Sleep(100)
MsgBox(0, "", ClipGet())
EndIf
WEnd

Thanks, this will work, now i just have to adapt it to the rest of the code.

Não, Sou PT

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


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
Sign in to follow this  

×