## 1. Project Overview & Quickstart (simular-ai/OSWorld)

## 1. Project Overview & Quickstart (simular-ai/OSWorld)

# OSWorld

Open-source repository simular-ai/OSWorld

### Repository Details
- **Repository:** [simular-ai/OSWorld](https://github.com/simular-ai/OSWorld)
- **Primary Language:** Code

*Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.*

## 2. Official Technical Reference & Guides (simular-ai/simular-ai.github.io)

## File: docs/API/SaveScreenshot.md

---
title: SaveScreenshot
parent: API
---

# API documentation

# SaveScreenshot(element:fileName:directory)


Takes a screenshot of an element on the screen or the whole screen, and saves the screenshot as a PNG to a file.


```swift
func SaveScreenshot(
        element: UIElement? = nil,
        fileName: String? = nil,
        directory: String? = nil
    )  
```

## Parameters

### element
If provided, limit the screenshot to the frame of the element. Default is the whole screen.

### fileName
Name for the image name, default is “simularSavedImage.png”.

### directory
Directory to save the image, default at desktop.


## Return Value

None


## Discussion

Examples:

- Instruction: Save screenshot of whole screen to screenshot.png
```swift
SaveScreenshot(fileName: "screenshot.png")
```
- Instruction: Screenshot the group element and save to clipboard
```swift
SaveScreenshot(element: group)
```
- Instruction: Screenshot the table element and save to /User/path/to/screenshot/
```swift
SaveScreenshot(element: table, directory: "/User/path/to/screenshot/")
```

---

## File: docs/API/ScreenshotToClipboard.md

# ScreenshotToClipboard(element)


Take a screenshot of an element or the current page and save it to the system clipboard


```swift
func ScreenshotToClipboard(element: UIElement? = nil)  
```

## Parameters

###  element
If provided, limit the screenshot to the frame of the element. Default is the whole screen.


## Return Value

None


## Discussion

Examples:

- Instruction: take screenshot and save to clipboard
```swift
ScreenshotToClipboard()
```
- Instruction: get the table element on the page, save a screenshot of it to clipboard
```swift
var elements = GetElements(elementRoles: ["table"])
ScreenshotToClipboard(element: elements[0])
```

## 2. Official Technical Reference & Guides (simular-ai/simular-ai.github.io)

## File: docs/API/SaveScreenshot.md

---
title: SaveScreenshot
parent: API
---

# API documentation

# SaveScreenshot(element:fileName:directory)


Takes a screenshot of an element on the screen or the whole screen, and saves the screenshot as a PNG to a file.


```swift
func SaveScreenshot(
        element: UIElement? = nil,
        fileName: String? = nil,
        directory: String? = nil
    )  
```

## Parameters

### element
If provided, limit the screenshot to the frame of the element. Default is the whole screen.

### fileName
Name for the image name, default is “simularSavedImage.png”.

### directory
Directory to save the image, default at desktop.


## Return Value

None


## Discussion

Examples:

- Instruction: Save screenshot of whole screen to screenshot.png
```swift
SaveScreenshot(fileName: "screenshot.png")
```
- Instruction: Screenshot the group element and save to clipboard
```swift
SaveScreenshot(element: group)
```
- Instruction: Screenshot the table element and save to /User/path/to/screenshot/
```swift
SaveScreenshot(element: table, directory: "/User/path/to/screenshot/")
```

---

## File: docs/API/ScreenshotToClipboard.md

# ScreenshotToClipboard(element)


Take a screenshot of an element or the current page and save it to the system clipboard


```swift
func ScreenshotToClipboard(element: UIElement? = nil)  
```

## Parameters

###  element
If provided, limit the screenshot to the frame of the element. Default is the whole screen.


## Return Value

None


## Discussion

Examples:

- Instruction: take screenshot and save to clipboard
```swift
ScreenshotToClipboard()
```
- Instruction: get the table element on the page, save a screenshot of it to clipboard
```swift
var elements = GetElements(elementRoles: ["table"])
ScreenshotToClipboard(element: elements[0])
```