Window.Activate
---------------

Activates the window.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Window](component_Window.md) | [2.8](newinversion28.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Window.Activate"; WindowRef ) 

**MBS**( **"Window.Activate";** /\* Activates the window. \*/  
**$WindowRef**) /\* Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the [Window.FindByTitle](WindowFindByTitle.md) or [Window.FindByIndex](WindowFindByIndex.md) functions. Pass zero to access the frontmost window. | 0 |

### Result

Returns OK on success.

### Description

Activates the window.  
This function does more than just show. if the window has been minimized, it will restore it. Also the window is moved to front and made the current window for keyboard input.  
  
Sadly windows limits which windows can go to front, so some windows may not come to front unless they are clicked on.  
  
As activation can be asynchronously, the window may activate later, e.g. in a script pause or at the end of the script.  
  
Use MBS( "[Process.SetFrontMost](ProcessSetFrontMost.md)" ) to move the whole app to the front.  
### See also

- [Process.SetFrontMost](ProcessSetFrontMost.md)
- [Window.FindByIndex](WindowFindByIndex.md)
- [Window.FindByTitle](WindowFindByTitle.md)

### Release notes

- **Version 7.2**
    - Fixed bug in [Window.Activate](http://www.mbsplugins.eu/WindowActivate.shtml).

### Example Databases

- [RemoteControl/Control Windows Calculator](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/RemoteControl/Control%20Windows%20Calculator.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS @ FMTraining.TV - MBS Open Q&amp;A](https://www.mbsplugins.de/archive/2025-05-22/MBS_@_FMTrainingTV_-_MBS_Open_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.2pr1](https://www.mbsplugins.de/archive/2017-04-03/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 29th March 2019

  
[WinSendMail.SetText](WinSendMailSetText.md) - [Window.AddBottomOverlay](WindowAddBottomOverlay.md)

[HTML Version](WindowActivate.shtml)