Skip to content

macOS command line utility to retrieve the CGWindowID of the specified window (potentially useful for `screencapture`).

License

Notifications You must be signed in to change notification settings

smokris/GetWindowID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

GetWindowID

macOS command line utility to retrieve the CGWindowID of the specified window (useful for screencapture).

Installation

Via Homebrew:

brew install smokris/getwindowid/getwindowid

Usage

./GetWindowID <application-bundle-name> <window-title>

For example, to get the ID of the iOS/tvOS/watchOS Simulator:

./GetWindowID Simulator 'iPhone X - iOS 11.0'

…and to capture a screenshot of it:

screencapture -l$(./GetWindowID Simulator 'iPhone X - iOS 11.0') simulator.png

To get the ID of a window without a title, pass an empty string as the title:

./GetWindowID GLFW ''

To list all of an app's windows, pass --list as the title:

./GetWindowID Simulator --list

About

macOS command line utility to retrieve the CGWindowID of the specified window (potentially useful for `screencapture`).

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published