I want to list opened windows in the terminal to get x, y, width and height like xwininfo -root -tree
for X11.
I tried:
osacript -e tell application "Microsoft Word" to get the bounds of the front window
But it's does not work for all Application and you can't specify a child (If you have two Word Document, it return the first opened).
In the Terminal app on your Mac, do one of the following: Press Command-T. Choose Shell > New Tab > New Tab with Profile. The name of the profile that opens is concatenated to the end of the New Tab with Profile menu item.
Using the tab context menu If you'd like to open a new pane of a profile that is already open in your terminal, you can right click on the tab and click Split Tab. This will duplicate the focused pane in the current tab.
Trying to use the Finder to open multiple instances of an application on Mac OS X will simply cause the first instance to come to the foreground. To get around this, use the open command from the command line with the -n option. The -n option opens a new instance of the application even if one is already running.
To get the position of all windows:
osascript -e 'tell application "System Events" to get the position of every window of every process'
The size:
osascript -e 'tell application "System Events" to get the size of every window of every process'
The title:
osascript -e 'tell application "System Events" to get the title of every window of every process'
Check the reference in AppleScript Editor for more properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With