Info:
Mac OS users are having trouble reading an SD card on the Nintendo Switch. This is all because the archive file attribute of HOS (Nintendo Switch OS) and macOS are used for different purposes.
I wrote a small application (applescript) that removes archive attributes for all files and folders on the Switch SD card.
It also takes into account the specificity of .nca folders and fixed them.
And lastly, it cleans up hidden unnecessary files for the Switch that macOS created when you worked with SD through the Finder.
In the new version, you can choose where you want to fix the attributes. On the entire map except the Nintendo folders on it (so as not to violate the attributes of the nca folders)
or you can fix the attributes of the Nintendo folders(if something is wrong with .nca attributes).
How to use:
1. Perform all the actions you need with the files and folders on the switch SD card.
2. Select the name of the SD card from the list.

3. Select a direction to fix:

(a) Fix bit all files - will remove the archive bit for all files and folders on SD except Nintendo folders.
(b) Fix bit Nintendo folders - restore archive bit for all .nca on SD card.
4. Enter the administrator password.

5. (a) Fix bit all files - the process is pretty fast

5. (b) Fix bit Nintendo folders - This process is not fast and depends on the number of .nca on the SD card.

6. Wait for notification of the end of the processes.
Done - Insert the SD card into the Switch.

Note:
You may need to allow applications not installed by Apple developers to be launched.
To do this, run the command in Terminal " sudo spctl --master-disable "

Code:
#switchSD v0.3.4
#by PlayerOne
property rm : "sudo rm -rf "
property arch : "sudo chflags -R arch "
set disksExternal to do shell script "mount | awk '/Volumes/ { print $3 }'"
set diskExternal to every paragraph of disksExternal
choose from list diskExternal with prompt "Select SD card for Nintendo Switch"
set the switchSD to the result
if switchSD is equal to false then return
set switchSD to quoted form of POSIX path of (switchSD as string)
set Fix to button returned of (display dialog "What do you want to fix?" buttons {"Fix bit Nintendo folders", "Fix bit all files"})
do shell script "sudo touch " & switchSD & " .metadata_never_index" with administrator privileges
if Fix is "Fix bit all files" then
set bitArchFiles to do shell script "find " & switchSD & "/* -path " & switchSD & " -prune -o -path " & switchSD & "/emuMMC -prune -o -path " & switchSD & "/Emutendo -prune -o -path " & switchSD & "/Nintendo -prune -o -depth 0 -print" with administrator privileges
set archFiles to every paragraph of bitArchFiles
set ProgressDialog to length of archFiles
set progress total steps to ProgressDialog
set progress completed steps to 0
set progress description to "Fix bit all"
set progress additional description to ""
repeat with bit from 1 to length of archFiles
set archBit to item bit of archFiles
set progress additional description to POSIX path of archBit
do shell script "sudo chflags -R arch " & quoted form of archBit with administrator privileges
set progress completed steps to bit
end repeat
end if
if Fix is "Fix bit Nintendo folders" then
set listNCAs to do shell script "find " & switchSD & "/ -name '*.nca' | grep .nca"
set NCAs to every paragraph of listNCAs
set ProgressDialog to length of NCAs
set progress total steps to ProgressDialog
set progress completed steps to 0
set progress description to "Fix bit NCA folders"
set progress additional description to ""
repeat with a from 1 to length of NCAs
set nca to item a of NCAs
set progress additional description to POSIX path of nca
set ncaF to do shell script "echo " & quoted form of nca & " | cut -d'.' -f-1"
do shell script "mkdir " & quoted form of ncaF with administrator privileges
do shell script "mv " & quoted form of nca & "/* " & quoted form of ncaF with administrator privileges
do shell script rm & quoted form of nca with administrator privileges
do shell script "mv " & quoted form of ncaF & " " & quoted form of (ncaF & ".nca") with administrator privileges
set progress completed steps to a
end repeat
end if
set progress total steps to 0
set progress completed steps to 0
do shell script "find " & switchSD & " -name '._*' -delete"
do shell script "find " & switchSD & " -name '.DS_Store' -delete"
do shell script rm & switchSD & "/.metadata_never_index" with administrator privileges
do shell script rm & switchSD & "/.Trashes" with administrator privileges
do shell script rm & switchSD & "/.fseventsd*" with administrator privileges
do shell script rm & switchSD & "/.Spotlight-V100" with administrator privileges
set progress description to "Unmount SD card"
set progress additional description to (switchSD as string)
do shell script "sudo diskutil unmount " & switchSD with administrator privileges
do shell script "afplay /System/Library/Sounds/Glass.aiff"
display notification "SwitchSD- Done" with icon
set progress description to ""
set progress additional description to ""
Version:
switchSD - v0.1
- the script works
switchSD - v0.2
- Added a progress bar to observe the process.
switchSD - v0.3
- The path selection for SD is changed, now the script checks external disks and displays the names.
- Separation of functions on fix bit for everything except .nca and fix bit .nca folders.
- Fixed the work of paths if the disc name contains spaces.
switchSD - v0.3.1
- Fixed bug bit archive for emuMMC folder.
switchSD - v0.3.2
- Changed drive search, now search all drives. The drive name must not contain spaces.
switchSD - v0.3.3
- add touch command .metadata_never_index (fix delete .Spotlight-V100 folder)
switchSD - v0.3.4
- bugfix Spotlight-V100 folder (10.15 too?), add Emutendo folder.
Attachments
Last edited by Player_One,