Kamel Labiad Kamel Labiad - 1 month ago 14
AppleScript Question

Applescript: How to get full path of the current finder window open?

I have this script it works fine but it don't give me the full link when I am opening a finder window on the network, wich should start with 'Volumes', how to make it detect it?

Thanks

tell application "Finder"
if exists window 1 then
set currentDir to POSIX path of ((target of front Finder window) as text)
else
set currentDir to POSIX path of (path to desktop folder)
end if
end tell
log currentDir

foo foo
Answer
tell application "Finder"
    if exists Finder window 1 then
        set currentDir to target of Finder window 1 as alias
    else
        set currentDir to desktop as alias
    end if
end tell
log POSIX path of currentDir
Comments