User Tools

Site Tools


token:WindowFrame

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
token:WindowFrame [2017/04/10 16:09]
JMichaelTX [WindowSize (FrontWindowSize)]
token:WindowFrame [2019/07/05 03:47] (current)
peternlewis
Line 1: Line 1:
-{{:​action:​window-icon.png?​nolink|}} +~~REDIRECT>​token:Window_Tokens~~
-====== Window Related Tokens ====== +
- +
-This Wiki page receives the redirect for a number or windows related tokens: +
- +
-  * [[token:WindowFrame|%WindowFrame%]] and [[token:​FrontWindowFrame|%FrontWindowFrame%]] +
-  * [[token:​WindowPosition|%WindowPosition%]] and [[token:​FrontWindowPosition|%FrontWindowPosition%]] +
-  * [[token:​WindowSize|%WindowSize%]] and [[token:​FrontWindowSize|%FrontWindowSize%]] +
- +
-Each of these text tokens return information about the specified window. ​  +
- +
-==== Token Parameters ==== +
- +
-Each one takes a parameter indicating which window to use.  The parameter is the value _after_ the percent sign of the main token.\\ +
-For example:​\\ +
-`%TokenName%TokenParameter%`\\ +
-`%WindowFrame%1%` +
- +
-The parameter may be: +
- +
-* Front or 0: the focused/​main window. Usually the same as index 1. +
-* Positive Number: the indexed window from front to back. +
-* Negative Number: the indexed window from back to front. +
- +
-So for example, //​%WindowFrame%1%//​ gives the frame of the front window. +
- +
-The Front variants are older versions that are equivalent to using Front as the parameter.  +
- +
-Like all coordinates in Keyboard Maestro, the WindowPosition and WindowFrame are from the top left corner of the main screen (the defined one with the menu bar on it, although this is less apparent now that the menu bar is on all monitors). +
- +
-==== WindowFrame (FrontWindowFrame) ==== +
- +
-The `%WindowFrame%` tokens returns the location of the window in pixels of left, top, width, and height of the window in a comma-delimited numerical string. +
- +
-`%FrontWindowFrame%` is a synonym for `%WindowFrame%Front%` and may be used interchangeably. +
- +
-Example Return of these tokens: +
- +
-``` +
-228,​23,​1314,​1173 +
- +
-left,​top,​width,​height +
-``` +
- +
-==== WindowPosition (FrontWindowPosition) ==== +
- +
-The `%WindowPosition%` tokens returns the location of the window in pixels of left and top of the window in a comma-delimited numerical string. +
- +
-`%FrontWindowPosition%` is a synonym for `%WindowPosition%Front%` and may be used interchangeably. +
- +
-Example Return of these tokens: +
- +
-``` +
-228,23 +
- +
-left,top +
-``` +
- +
-==== WindowSize (FrontWindowSize) ==== +
- +
-The `%WindowSize%` tokens returns the size of the window in pixels of width and height of the window in a comma-delimited numerical string. +
- +
-`%FrontWindowSize%` is a synonym for `%WindowSize%Front%` and may be used interchangeably. +
- +
-For example, these tokens return values for:\\ width,​height:​ +
- +
- +
-``` +
-1314,1173 +
-``` +
- +
---- +
-==== Accessing Window and Screen Coordinates ==== +
- +
-When a Window or screen token returns a set of 4 comma-delimited values as one result into a Keyboard Maestro Variable (which is always text), you can access the individual values, and calculate other values, by using certain key words appended to the Variable name in a [[token:​Calculate|Calculate Token]], such as the following:​ +
- +
-{{:​token:​km-7.3-window-coordinates.png?​nolink|}} +
- +
-This produces the following results, in the Display Action: +
- +
-``` +
-Window Frame: ​ 2810,​66,​1281,​1049 +
- +
-Left:​ 2810 +
-Top: 66 +
-Width:​ 1281 +
-Height:​ 1049 +
- +
-Right:​ 4091 +
-Bottom:​ 1115 +
-MidX:​ 3450.5 +
-MidY:​ 590.5 +
-``` +
- +
-For WindowPosition,​ you can use Left and Top, and for WindowSize you can use Width and Height. +
- +
-=== Screen/​Window Keyword "​coordinates"​ === +
- +
- +
-* Left +
-* Right +
-* Top +
-* Bottom +
-* Width +
-* Height +
-* MidX +
-* MidY +
- +
---- +
- +
-===== See Also ===== +
- +
----- +
- +
-=== Functions === +
- +
-* [[function:​SCREEN|SCREEN()]] +
-* [[function:​SCREENVISIBLE|SCREENVISIBLE()]] +
-* [[function:​WINDOW|WINDOW()]] +
-* [[function:​WINDOWCOUNT|WINDOWCOUNT()]] +
-* [[:​Functions|See all Functions]] +
- +
-=== Tokens === +
- +
-* [[token:​FrontWindowName|%FrontWindowName%]] +
-* [[token:​FrontWindowFrame|%FrontWindowFrame%]] +
-* [[token:​FrontWindowPosition|%FrontWindowPosition%]] +
-* [[token:​FrontWindowSize|%FrontWindowSize%]] +
-* [[token:​WindowName|%WindowName%]] +
-* [[token:​WindowFrame|%WindowFrame%]] +
-* [[token:​WindowPosition|%WindowPosition%]] +
-* [[token:​WindowSize|%WindowSize%]] +
-* [[:​Tokens|See all Tokens]] +
- +
-=== Triggers === +
- +
-* [[trigger:​Focused Window|Focused Window trigger]] +
-* [[:​Triggers|See all Triggers]] +
- +
----- +
- +
-==== Forum ==== +
- +
-- [[https://​forum.keyboardmaestro.com/​t/​trapping-dialogs-in-pause-condition/​3046/​4|Trapping dialogs in Pause condition]] +
- +
-- [[https://​forum.keyboardmaestro.com/​search?​q=WindowFrame|Keyboard Maestro Forum topics about WindowFrame]]+
token/WindowFrame.1491854985.txt.gz · Last modified: 2017/04/10 16:09 by JMichaelTX