How to programatically open Settings/Preferences window in a macOS SwiftUI App

By inspecting the app menu, I found this solution: NSApp.sendAction(Selector((“showPreferencesWindow:”)), to: nil, from: nil) I assume that it may not pass App Review for using a private API, though, so less shady alternatives are still welcome. Update: This has actually passed App Review, so I had marked it as the answer. Update 2: For a … Read more

Sublime Text 2 / Sublime Text 3 bring back unsaved files on osx

Sublime Text 2 stores the files in ~/Library/Application Support/Sublime Text 2/Settings, in the .sublime_session files that are located there. The contents of those files are a large JSON blob that contains the individual tab contents. Search in the file for the file name / tab name / a key word in the document and you … Read more

How to prevent Figma Agent to be added to Login Items

removing FigmaAgent.app rm -fr ~/Library/Application\ Support/Figma/FigmaAgent.app creating a dummy file touch ~/Library/Application\ Support/Figma/FigmaAgent.app make the file undeletable sudo chflags -R schg ~/Library/Application\ Support/Figma/FigmaAgent.app Now Figma will not be able to override that file when it wants to update it and you don’t have to fiddle with the .app everytime Figma updates itself. Also the login … Read more

On VS Code on macOS, how to keep two projects open in macOS window tabs (instead of two windows)?

Go to Preferences > Settings. Search for native tabs Check the checkbox Code will prompt for restart to take effect. After restart, make sure you have multiple projects open. And then merge all windows as shown below: Enjoy multiple tabs in single window. Note: I think this applies to all Mac OS >= Sierra. Tested … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)