File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,19 @@ The following example shows how to get the currently focused window's title and
1717``` javascript
1818const { windowManager } = require (" node-window-manager" );
1919
20- windowManager .requestAccessibility (); // required on macOS
21-
2220const 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 .
2830window .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.
Original file line number Diff line number Diff 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 `
You can’t perform that action at this time.
0 commit comments