https://github.com/wk-j/mac-active-window
Get window information
https://github.com/wk-j/mac-active-window
Last synced: 26 days ago
JSON representation
Get window information
- Host: GitHub
- URL: https://github.com/wk-j/mac-active-window
- Owner: wk-j
- Created: 2016-10-15T15:11:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T14:19:15.000Z (about 7 years ago)
- Last Synced: 2025-02-08T18:14:53.800Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Active Window
- [x] Find window location
- [x] Find screen size
- [x] Resize front most window## Install
```
npm install --save mac-active-window
```## Find window location from PID
```javascript
import * as lib from "mac-active-window";let pid = 38111;
let location = lib.findActiveWindow(pid);location.then(rs => {
let winLocation = rs.location;
console.log(winLocation.x);
console.log(winLocation.y);
console.log(winLocation.width);
console.log(winLocation.height);
});
```## Find screen size
```javascript
import * as lib from "mac-active-window";let size = lib.findScreenSize();
size.then(rs => {
console.log(rs.width);
console.log(rs.height);
});```
## Resize front most window
```javascript
import * as lib from "mac-active-window";lib.resizeFrontMostWindow(500, 300);
```