Revisions
-
beelsebob revised this gist
Sep 19, 2015 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,11 +7,9 @@ class Window { } var processID: pid_t { let pid : pid_t AXUIElementGetPid(element, &pid) return pid } } -
Jakob Alminde created this gist
Sep 19, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ class Window { let element: AXUIElementRef init?(processID: pid_t) { element = AXUIElementCreateApplication(processID).takeRetainedValue() } var processID: pid_t { let pointer = UnsafeMutablePointer<pid_t>.alloc(1) AXUIElementGetPid(element, pointer) let value = pointer.memory pointer.dealloc(1) return value } }