Jump to content

get file name


 Share

Recommended Posts

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

Link to comment
Share on other sites

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

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