Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

Try:

tell application "Skype" to id of first window whose name = ""
share|improve this answer
    
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 '13 at 15:21
    
I didn't try the screen capture. I just found the new window id. –  adayzdone Apr 2 '13 at 15:24
    
I tried again, with the same skype call running. This time I got Invalid index. (-1719). Weird... –  m000 Apr 2 '13 at 16:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.