Skip to content

Commit d2af3c9

Browse files
committed
docs: improve the example in readme
1 parent cd7ca0a commit d2af3c9

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ The following example shows how to get the currently focused window's title and
1717
```javascript
1818
const { windowManager } = require("node-window-manager");
1919

20-
windowManager.requestAccessibility(); // required on macOS
21-
2220
const window = windowManager.getActiveWindow();
2321

24-
// Prints the currently focused window title.
25-
console.log(window.getTitle());
22+
// Prints the currently focused window bounds.
23+
console.log(window.getBounds());
24+
25+
// This method has to be called on macOS before changing the window's bounds, otherwise it will throw an error.
26+
// It will prompt an accessibility permission request dialog, if needed.
27+
windowManager.requestAccessibility();
2628

27-
// Moves the window.
29+
// Sets the active window's bounds.
2830
window.setBounds({ x: 0, y: 0 });
2931
```
3032

3133
# Documentation
32-
The documentation and API references are located in the [`docs`](docs) directory.
34+
35+
The documentation and API references are located in the [`docs`](docs) directory.

docs/breaking-changes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ The `windowManager.requestAccessibility` method won't be required before each op
2626
- `window.minimize`
2727
- `window.restore`
2828
- `window.bringToTop`
29-
- `window.getTitle`
29+
- `window.getTitle`

0 commit comments

Comments
 (0)