Trying to implement a quick action to hide file extensions
Found a post to do this but can't get it working. Has anyone got a quick action that I can just plug in?
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
Found a post to do this but can't get it working. Has anyone got a quick action that I can just plug in?
Why don't you pass in the selected files from the Finder into the Quick Action, which is using a Run AppleScript action. In a loop, you test if the items extension is hidden or not and set it to the opposite, or do nothing, depending on your goal. The following Run AppleScript will hide the extensions of all files in a selected folder, or any selected file in the Finder:
use scripting additions
on run {input, parameters}
-- recursively hide file extensions in a selected folder, or on
-- individually selected files in the Finder
tell application "Finder"
repeat with anItem in input
if kind of anItem is "Folder" then
set theFiles to (every file in entire contents of folder anItem)
repeat with afile in theFiles
set extension hidden of afile to true
end repeat
else
set extension hidden of anItem to true
end if
end repeat
end tell
return
end run
Why don't you pass in the selected files from the Finder into the Quick Action, which is using a Run AppleScript action. In a loop, you test if the items extension is hidden or not and set it to the opposite, or do nothing, depending on your goal. The following Run AppleScript will hide the extensions of all files in a selected folder, or any selected file in the Finder:
use scripting additions
on run {input, parameters}
-- recursively hide file extensions in a selected folder, or on
-- individually selected files in the Finder
tell application "Finder"
repeat with anItem in input
if kind of anItem is "Folder" then
set theFiles to (every file in entire contents of folder anItem)
repeat with afile in theFiles
set extension hidden of afile to true
end repeat
else
set extension hidden of anItem to true
end if
end repeat
end tell
return
end run
You need to perform two steps. Enforce the hide and then restart the Finder so it reads the change to the preference. Something like this can work:
This is using a defaults command to toggle the view of extensions to false (don't show) and an AppleScript to quit the Finder and then launch it. Save this as a Quick Action and it will appear in your Services menu (Enable Finder Suffixes).
By any chance are your devices managed by an MDM? If so, just issue this as a configuration profile. Please note, if the users figured out how to turn the on and you want it off, then the solution above can be overridden by the end users. It is not enforcing the setting, it is only toggling it when run. If you want to enforce the setting, use a profile in MDM.
Hope this helps. Quick and simple. You did not share the original post so I am making assumptions this is what you want done.
Reid
Yup. Found your earlier post with this script. Implemented it yesterday after a little learning curve. Works beautifully.
Many thanks.
You are welcome.
Trying to implement a quick action to hide file extensions