Jump to content

Recommended Posts

Posted

if there is only 1 window open (which is a folder).........and there is only 1 item in that folder.....what is the code to get the name of that one and only file in the open window.

Posted

What type of file is it?

Without know any thing about what you are doing.

As an initial thought you can use FileGetShortName or FileGetLongName to retrieve the info.

Posted

I am a Mac user coming from Applescript. In Applescript you just do something like this. It does not matter what type of file it is, it returns the whole name

Tell application "Finder"

set the_file to get name of item 1 of finder window 1

-- the result might be "The Grand Canyon.jpg"

end tell

Posted

#include <String.au3>

$_WinGetText = WinGetText("[ACTIVE]")

$__StringBetween = _StringBetween($_WinGetText, "Address: ", @LF)

$_FileFindFirstFile = FileFindFirstFile($__StringBetween[0] & "*.*")

If $_FileFindFirstFile <> -1 And Not @error Then
    $file = FileFindNextFile($_FileFindFirstFile)
    ConsoleWrite($file & @LF)
EndIf

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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
  • Recently Browsing   0 members

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