Skip to content

Commit 5f889e5

Browse files
committed
add windows support to open action
1 parent 09439b9 commit 5f889e5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gui_agents/s3/agents/grounding.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ def open(self, app_or_filename: str):
397397
return f"import pyautogui; pyautogui.hotkey('win'); time.sleep(0.5); pyautogui.write({repr(app_or_filename)}); time.sleep(1.0); pyautogui.hotkey('enter'); time.sleep(0.5)"
398398
elif self.platform == "darwin":
399399
return f"import pyautogui; import time; pyautogui.hotkey('command', 'space', interval=0.5); pyautogui.typewrite({repr(app_or_filename)}); pyautogui.press('enter'); time.sleep(1.0)"
400+
elif self.platform == "windows":
401+
return (
402+
"import pyautogui; import time; "
403+
"pyautogui.hotkey('win'); time.sleep(0.5); "
404+
f"pyautogui.write({repr(app_or_filename)}); time.sleep(1.0); "
405+
"pyautogui.press('enter'); time.sleep(0.5)"
406+
)
407+
else:
408+
assert (
409+
False
410+
), f"Unsupported platform: {self.platform}. Supported platforms are: darwin, linux, windows."
400411

401412
@agent_action
402413
def type(

0 commit comments

Comments
 (0)