AppleScript: come nascondere l'estensione del file di uno screenshot?

4
set filePath to "/Users/Me/Desktop/" & "Screenshot" & ".png"

do shell script "screencapture -mx -T1 " & filePath

tell application "Finder"
    set extension hidden of (filePath as POSIX file) to false
end tell

Il codice sopra riportato produce l'errore:

Finder got an error: Can’t set extension hidden of file "Macintosh HD:Users:Me:Desktop:Screenshot.png" to false.

    
posta rubik's sphere 03.02.2017 - 06:44
fonte

1 risposta

3

Eri vicino! Devi utilizzare file davanti a (filePath as POSIX file) , ad esempio:

set filePath to "/Users/Me/Desktop/" & "Screenshot" & ".png"

do shell script "screencapture -mx -T1 " & filePath

tell application "Finder"
    set extension hidden of file (filePath as POSIX file) to false
end tell
    
risposta data 03.02.2017 - 07:22
fonte

Leggi altre domande sui tag