This file contains 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 python3 | |
#ref: https://gist.github.com/pudquick/eebc4d569100c8e3039bf3eae56bee4c | |
from Foundation import NSBundle | |
import objc # pip3 install objc | |
CoreServices = NSBundle.bundleWithIdentifier_('com.apple.CoreServices') | |
functions = [ | |
('_LSCopyRunningApplicationArray', b'@I'), | |
('_LSCopyApplicationInformation', b'@I@@'), |
This file contains 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 Dispatch | |
import Foundation | |
// The Weak struct is the weak wrapper | |
struct Weak<T: AnyObject> { | |
weak var object: T? | |
} | |
// Stand-in for AUGraphAddRenderNotify | |
func call( |
This file contains 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 Cocoa | |
let path = "/Users/You/Pick/Any/Random/File/On/Your/System.txt" | |
let destination = URL(fileURLWithPath: path) | |
let progress: Progress = { | |
let p = Progress(parent: nil, userInfo: [ | |
.fileOperationKindKey: Progress.FileOperationKind.downloading, | |
.fileURLKey: destination, | |
]) |