Jump to content

Get file path on left click?


careca
 Share

Recommended Posts

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

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

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

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.

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

Link to comment
Share on other sites

#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

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

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

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.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...