CareyB
December 14, 2015, 3:40pm
1
Keyboard Maestro “Display Text” Action
Since I am a keyboard cowboy, and I move my windows around using hot keys, here's a quickie - demonstrating the ease of use of KM - showing the current app, window name, and dimensions in KM format.
Display Text.kmactions (1.2 KB)
ccstone
December 14, 2015, 4:23pm
2
Hey Carey,
You'll probably want to note this thread then.
Newbie question. I’m writing a macro that must click in precise locations on a window in order to activate the correct parts of a program. For example, I need to fill in a certain dialog box.
The correct command is Move and Click at (x,y) from the Front Window.
But, is there a way to figure out x and y without just trial and error? For example, here is a program to measure screen locations, but it’s $10. http://www.ondesoft.com/rulers/pixel-ruler.html
I have a retina display - I’m not sure if…
Also this:
http://flipmartin.net/software/tips-and-tricks-for-keyboard-maestro
Search for: 'Get Cursor Position'
I think Philippe's was first.
-Chris
CareyB
December 14, 2015, 4:43pm
3
I found the second one very helpful, but is there any way to bypass creating the intermediate variable?
For example: Can I address the ‘Width’ component of this directly?
%ScreenVisible%Front%
I’m looking for something like this %ScreenVisible%Front.Left%
CareyB
December 14, 2015, 5:48pm
4
Perhaps I should elaborate: I’m looking to perform a switch comparing the current window frame (%WindowFrame%1%) to a percentage of the current screen size.
Example Array:
ScreenVisible(Front,Left)*10%, ScreenVisible(Front,Top), ScreenVisible(Front,Width)*80%, ScreenVisible(Front,Height)
Does that make sense?
ccstone
December 14, 2015, 6:08pm
5
Hey Carey,
Scope out the Screen & Window Functions:
https://wiki.keyboardmaestro.com/function/SCREEN
https://wiki.keyboardmaestro.com/function/WINDOW
%Calculate% SCREEN(Main, Bottom) * 0.8 %
-Chris
CareyB
December 14, 2015, 9:10pm
6
Doh!!! I keep forgetting that there are complimentary tokens and functions.
Never mind…
CareyB
December 14, 2015, 9:52pm
7
Looks like this works in a ‘set variable to calculation’ window, but in a ‘set variable to text’ %Calculation% it’s not happy:
SCREENVISIBLE(Front,Left,20%),SCREENVISIBLE(Front,Top),SCREENVISIBLE(Front,Width)*60%,SCREENVISIBLE(Front,Height)
I need the array to do the comparison in the switch statement.
ccstone
December 15, 2015, 8:42pm
8
Hey Carey,
You're missing the fact that the calculation token uses the percent sign as a delimiter, so your use of '%' within the calculation causes problems.
%Calculate%SCREENVISIBLE(Front,Right)*20/100%
I don't know if there's a way to escape the '%' character, so the calculation sees it in context – Peter will have to weigh-in on that.
-Chris
Nope. Within a %Calculate% you cannot use a percent sign.