Created
March 3, 2024 21:36
-
-
Save dnicolson/42a8342b93fba49cbf1d69c82daeb7f0 to your computer and use it in GitHub Desktop.
Perform "Fix All Issues" for an array of files in Xcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript -l JavaScript | |
var filePaths = []; | |
function fixFile(filePath) { | |
console.log(filePath); | |
var xcode = Application('Xcode'); | |
xcode.activate(); | |
xcode.open(filePath); | |
var systemEvents = Application('System Events'); | |
var xcodeProcess = systemEvents.processes.byName('Xcode'); | |
xcodeProcess.menuBars[0].menuBarItems.byName('Editor').menus[0].menuItems.byName('Fix All Issues').click(); | |
// systemEvents.keystroke('w', { using: 'command down' }); | |
} | |
filePaths.forEach(fixFile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment