Archivos con extension dmg

broken image
broken image

If you have Xcode installed, you will get the SetFile(1) binary, which does exactly what you want (and offers a few more functions related to file attributes): Save this as filename.scpt and run it from the command line with: osascript filename.scpt targetfile Tell application 'Finder' to set extension hidden of (POSIX file (first item of argv) as alias) to true You can run this straight from a script file too (thanks for the addition): on run argv The full call is then, for example: set extension hidden of alias 'Macintosh HD:Users:werner:Desktop:file.png' to true To reverse, just exchange true with false here. Set extension hidden of some_file to true We can get that, for example, though a dialog. You obviously need an alias to a file object.

broken image

We can however use a tool to do it for us.įor the below to work, you obviously need to have Show all file extensions unchecked in Finder's preferences.ĪppleScript offers this functionality with the set extension hidden command. Checking this changes the extended attribute, which you normally can't edit – at least not easily. The only real way to change this via GUI is to click Hide extension in the Finder Info window.