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 | |
const $attr = Ref(); | |
const $windows = Ref(); | |
const $children = Ref(); | |
const UNICODE_PATTERN = '11110xxx10xxxxxx10xxxxxx10xxxxxx'; | |
function run(_) { | |
const app = $.AXUIElementCreateApplication( |
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
// | |
// main.m | |
// EscapedUnicodeCharConvertExample | |
// | |
// Created by Stephan Casas on 5/22/23. | |
// | |
#import <Foundation/Foundation.h> | |
NSString* escapedUnicharToString(NSString* escapedUnicharString) { |
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 | |
const App = Application.currentApplication(); | |
App.includeStandardAdditions = true; | |
function run(_) { | |
const finderPrefs = $.NSMutableDictionary.dictionaryWithContentsOfFile( | |
`${$.NSHomeDirectory().js}/Library/Preferences/com.apple.finder.plist`, | |
); |
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 | |
const CERT_PATH = '/tmp/sim-cert-install.pem'; | |
// NOTE: This is intended to be used as an Alfred Workflow. | |
// If you don't have Alfred, just replace the value of | |
// `argv` with the URL for the site whose root trust | |
// needs to be added. | |
function run([argv = '']) { |
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 | |
function run(argv) { | |
ObjC.bindFunction('NSColorGetUserAccentColor', ['int', []]); | |
ObjC.bindFunction('NSColorSetUserAccentColor', ['bool', ['int']]); | |
console.log($.NSColorGetUserAccentColor()); | |
console.log($.NSColorSetUserAccentColor(4)); | |
return 0; |
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
// | |
// SwiftUI_NSAlertExampleApp.swift | |
// SwiftUI_NSAlertExample | |
// | |
// Created by Stephan Casas on 6/20/23. | |
// | |
// This example requires the [NSViewProxy](https://github.com/stephancasas/NSViewProxy) | |
// package to acquire the pre-draw window context in `ContentView`. | |
// |
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
import SwiftUI | |
@main | |
struct ExampleApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
} |
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
// | |
// ColorFloodExample.swift | |
// ColorFloodExample | |
// | |
// Created by Stephan Casas on 6/28/23. | |
// | |
import SwiftUI; | |
import Accelerate; | |
import CoreGraphics; |
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
// | |
// CGEventSupervisor.swift | |
// Mouseless Messenger Pro | |
// | |
// Created by Stephan Casas on 4/24/23. | |
// | |
import Cocoa; | |
class CGEventSupervisor { |