MCPcopy Create free account
hub / github.com/browser-use/macOS-use / wait_for_app_ready

Function wait_for_app_ready

examples/basic_agent.py:25–46  ·  view source on GitHub ↗

Wait for app to be ready with detailed status checking

(app, max_attempts=10, delay=2.5)

Source from the content-addressed store, hash-verified

23
24
25async def wait_for_app_ready(app, max_attempts=10, delay=2.5) -> bool:
26 """Wait for app to be ready with detailed status checking"""
27 for i in range(max_attempts):
28 try:
29 if not app:
30 print(f'Attempt {i + 1}/{max_attempts}: App object is None')
31 await asyncio.sleep(delay)
32 continue
33
34 if app:
35 app.activateWithOptions_(Cocoa.NSApplicationActivateIgnoringOtherApps)
36 await asyncio.sleep(1)
37 print(f'✅ App is running and ready')
38 return True
39
40 await asyncio.sleep(delay)
41
42 except Exception as e:
43 print(f'Error checking app status: {e}')
44 await asyncio.sleep(delay)
45
46 return False
47
48
49class FolderCreationState:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected