Jump to content

Recommended Posts

Posted

I have a really awful way of getting the name of a selected file in a directory.

Surely, there's a better way, but I can't find it in Help. Help, please.

Func GetFileName()

Send("{APPSKEY}")

Sleep(200)

Send("m")

Sleep(200)

Send("^{c}")

Send("{ESC}")

$filename = ClipGet()

; MsgBox(0, "", $filename)

EndFunc ;==>GetFileName

  • Moderators
Posted

If you're using Win XP ( unsure about Vista ), your explorer and desktop are SysListview32's.

Which means you can access them via the _GUICtrlListView_* functions. And ultimately find which were highlighted and get the text from that.

On Win 7 ( the machine I have access to now ), my desktop is SysListview32, however, explorer is DirectUIHWND.

I'm unsure off hand how to automate that, maybe if you did some research into it, you could find a cleaner method than what you're using now along the lines of what I said about the _GUICtrlListview* functions.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Check out the combined function KaFu made called '_WindowsExplorer_ExtractSelectedDirAndFiles' in

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
×
×
  • Create New...