sbrady Posted August 31, 2012 Posted August 31, 2012 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.
stealthmsgr Posted August 31, 2012 Posted August 31, 2012 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.
sbrady Posted August 31, 2012 Author Posted August 31, 2012 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
JohnOne Posted August 31, 2012 Posted August 31, 2012 #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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now