On 23 Mar 2014, at 4:27 am, koenig.yvan <email@hidden> wrote:
tell application "AppleScript Editor" name of windows whose visible is true --> {"100titre.scpt"} name of windows whose miniaturized is true --> {"Historique des événements", "Sans titre"} name of windows whose visible is false --> {"grab recently modified v6.scpt", "Historique des événements", "Create ITP from Client's Mail-Conversation Inquiry.scpt", "Sans titre", "Sans titre 2", "Sans titre", "Create ITP from Client's Mail-Conversation Inquiry copy 20140322.scpt", "Create ITP from Client's Mail-Conversation Inquiry.scpt", "Sans titre", "Sans titre 2", "Sans titre 2", "Create ITP from Client's Mail-Conversation Inquiry 20140322 YK.scpt"}
What is puzzling is what is returned as list of windows whose visible is false. The name which I put in bold is the minimized one. The others are in fact those which were opened today but are now closed.
Designed feature or funny bug ?
Well it's a bug, but an interesting one -- at least to me.
When I first added scriptability to AppleScriptObjC Explorer 2, I saw the same thing happening. At the time I thought it might be a problem with garbage collection not releasing the windows when they were closed, or something I was doing wrong. The list is supplied by a simple method all applications have, orderedWindows, and it's there explicitly for use in scripting. In the end I couldn't track down the problem (and I spent a long time on it), so I simply overrode orderedWindows with my own version that returned the correct result. When I wrote ASObjC Explorer for Mavericks, I didn't have the problem any more, so I wondered whether it was just a result of the previous version using garbage collection. Whatever.
My real point is that it suggests the problem is with the built-in method, which means it could well behave the same in other scriptable apps. So from that point of view, it's definitely worth reporting as a bug.
|