Show windows by window ID in certain application


We have a script in our application that makes a window with a certain ID visible:

with timeout of 2 second
 tell application "Some Application" to set visible of window id 111 to true 
end timeout 

(Of course instead of Some Application and the id 111 we use real values)

The problem is that at some point the property visible became readonly and if on Yosemite it still works, on El Capitan it returns error -10006

How should I change this script in order to run it on El Capitan?

Thanks in advance!


Model: Any
Browser: Safari 601.1.56
Operating System: Mac OS X (10.10)