3

I am trying to automate the periodic capture of a floating window. Specifically, of the floating 'Current Call' window which is used by Skype when the main window is off-screen.

By googling, I found out that all I need is a window id to pass to screencapture:

screencapture -l<win_id> <output_file>

The problem is that I haven't found a way to get the window id for "Current Call". Here is what I have tried so far:

$ osascript -e 'tell app "Skype" to id of first window whose floating is true'
20:61: execution error: Skype got an error: Can’t get window 1 whose floating = true. Invalid index. (-1719)
$ osascript -e 'tell app "Skype" to id of first window whose name is "Current Call"'
20:67: execution error: Skype got an error: Can’t get window 1 whose name = "Current Call". Invalid index. (-1719)

Does anyone know how to get the window id for the "Current Call" window?

Or, alternatively, does anyone know if I can get this screenshot in some other way? (e.g. run screencapture with other arguments, or use some other tool for capturing the screenshot)


Update

I have also tried the following:

$ osascript -e 'tell app "Skype" to id of window 0'
-1
$ osascript -e 'tell app "Skype" to id of window 1'
-1
$ osascript -e 'tell app "Skype" to id of window 2'
84
$ osascript -e 'tell app "Skype" to id of window 3'
20:22: execution error: Skype got an error: Can’t get window 3. Invalid index. (-1719)

Window with id 84 is the main skype window. So, I'm a bit puzzled here. What is -1 supposed to mean?

2 Answers 2

1

I wrote a command line utility that wraps over screencapture and the Quartz windowing library.

Grab it here: https://github.com/thismachinechills/pyscreencapture

Use it like this:

./screencapture.py Skype -t Current Call -w all_windows above_window
0

Try:

tell application "Skype" to id of first window whose name = ""
3
  • Did you try this? It returns some window id but the screen capture for it gives me this image, which I have no idea what is: i.imgur.com/3KDh1rA.png
    – m000
    Apr 2, 2013 at 15:21
  • I didn't try the screen capture. I just found the new window id.
    – adayzdone
    Apr 2, 2013 at 15:24
  • I tried again, with the same skype call running. This time I got Invalid index. (-1719). Weird...
    – m000
    Apr 2, 2013 at 16:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .