Jump to content

Name of Manually Selected File in Directory


Recommended Posts

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

Link to comment
Share on other sites

Most people would use FileSaveDialog or FileOpenDialog.

Richard,

Wouldn't that bring up the dialog box? What I am looking for is a function that provides the information that the Properties option on the Appsmenu does, but maybe more info. The function I'm hoping to find would provide information such as long and short file names of whichever file happens to have the focus in whichever directory I'm in.

Link to comment
Share on other sites

Well I didn't understand the context of your question.

It's my fault.

I want to pass the name of a selected file as a token to an application. Like the Sendto option. The method I use (which I'm looking to replace) manipulates keys with the Sendkeys and extracts a file name. I was hoping there was an AutoIt function that would just give information about whichever object is highlighted in a directory. For example, I go into my Html directory and arrow down and decide I want to check a particular file using HTML-Kit. So I get the file name of the highlighted file, as shown above and in my AutoIt application I issue:

ShellExecute("C:\Program Files\Chami\HTML-Kit\Bin\HTMLKit.exe", 'C:\Test2\'&$filename)

Window must have a slew of information about any particular file or object that is highlighted. What I am wondering is if AutoIt can provide that information.

Link to comment
Share on other sites

  • Moderators

RobertBedrosian,

Go and look at your double post in the Help section - you have the answers there (as well as from Mat here). :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

If this is indeed part of a double post, then it's the post here that needs removing, as this is the CHAT section NOT HELP section.

At the very least, it needs relocation.

RobertBedrosian you should know better ... and Melba23 is being too kind to you!

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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...