You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically correct and update metadata in Nintendo Switch captures imported to Apple Photos
4
+
5
+
## Features
6
+
7
+
- Identifies and corrects the incorrect date and time metadata produced by Switch system software versions prior to 10.0.0
8
+
- Adds Keywords for both Nintendo Switch and individual games to each capture
9
+
- Grabs individual game names from <https://github.com/RenanGreca/Switch-Screenshots>
10
+
11
+
## Usage
12
+
13
+
You will need to set up an Album in Photos for Switch Capture Tagger to work from due to the slow nature of querying the Photos database.
14
+
15
+
The album needs to be called "Switch Capture Tagger Scratch". A Smart Album with these parameters can help to target likely Switch captures:
16
+
17
+
Match [all ] of the following conditions:
18
+
[Camera Model ] [is empty ]
19
+
[Lens ] [is empty ]
20
+
[Filename ] [includes ] [-]
21
+
[Filename ] [does not include ] [ ]
22
+
[Filename ] [does not include ] [n]
23
+
[Filename ] [does not include ] [o]
24
+
25
+
Note that this works well with target albums of around 300 files on my machine. Larger albums tend to time out when querying and I have yet to find a workaround. If your Smart Album returns a very large number of items, you may need to rename it and use a manually-managed album where you drag around 150-300 items and run Switch Capture Tagger over each group. Suggestions for how to better handle this performance problem are very welcome!
26
+
27
+
The script is in `Switch Capture Tagger.js`, and can be opened in Script Editor and run from there (you'll need to select JavaScript where it very likely says AppleScript under the toolbar; Script Editor doesn't have a plain-text extension which indicates JavaScript).
28
+
29
+
An easier option is to run the build script, `build.sh`, which will produce a `Switch Capture Tagger` Application.
30
+
31
+
This application can be run from anywhere, and will request access to control Photos before proceeding.
message: `${albums.length>1 ? 'Too many matching albums were' : 'No matching album was'} found.\n\nPlease make sure there is a “${SMART_ALBUM_NAME}” Smart Album which filters for items with empty Camera Model and Lens, and file names including “-” and not including “n”, “o” or “ ”.\n\nFor more information please see the script.`
50
+
}
51
+
);
52
+
53
+
return2;
54
+
}
55
+
56
+
Progress.additionalDescription="Downloading list of Nintendo Switch title IDs";
57
+
58
+
// We pinch a mapping of title IDs to game names from the Switch-Screenshots project
Progress.description="Finished processing Nintendo Switch captures";
179
+
Progress.additionalDescription="Reporting the results to you!";
180
+
181
+
if(matchedItems==0){
182
+
ScriptRunner.displayAlert(
183
+
"Switch Capture Tagger",
184
+
{
185
+
as: 'critical',
186
+
message: `No Switch captures were found in the “${SMART_ALBUM_NAME}” Smart Album.\n\nIf you expected some, double check they weren't renamed before importing.`
187
+
}
188
+
);
189
+
190
+
return1;
191
+
}else{
192
+
ScriptRunner.displayAlert(
193
+
"Switch Capture Tagger",
194
+
{
195
+
as: 'informational',
196
+
message: `Of the ${matchedItems.toLocaleString()} Switch capture${matchedItems.toLocaleString===1 ? '' : 's'} in “${SMART_ALBUM_NAME}”, ${updatedItems.toLocaleString()} needed metadata updates.`
# We *don't* use Apple Music, Calendars, Camera, Contacts, HomeKit,
41
+
# Microphone, Photo Library API, Reminders, Siri or Administrator access
42
+
deleteInfo NSAppleMusicUsageDescription
43
+
deleteInfo NSCalendarsUsageDescription
44
+
deleteInfo NSCameraUsageDescription
45
+
deleteInfo NSContactsUsageDescription
46
+
deleteInfo NSHomeKitUsageDescription
47
+
deleteInfo NSMicrophoneUsageDescription
48
+
deleteInfo NSPhotoLibraryUsageDescription
49
+
deleteInfo NSRemindersUsageDescription
50
+
deleteInfo NSSiriUsageDescription
51
+
deleteInfo NSSystemAdministrationUsageDescription
52
+
53
+
# Update relevant metadata
54
+
writeInfo NSAppleEventsUsageDescription "Access to control Photos is necessary so Switch Capture Tagger can find Switch captures, read their names, and update their date, time and keywords"
0 commit comments