User Tools

Site Tools


JavaScript_for_Automation

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
Next revision Both sides next revision
JavaScript_for_Automation [2016/04/27 09:28]
peternlewis [The Automation interface]
JavaScript_for_Automation [2016/04/27 22:16]
peternlewis [Accessing Keyboard Maestro Variables]
Line 276: Line 276:
 =====Accessing Keyboard Maestro Variables===== =====Accessing Keyboard Maestro Variables=====
  
-You can access Keyboard Maestro variables from JXA scripts using the Keyboard Maestro Engine application.+You can access Keyboard Maestro variables ​(7.1+) ​from JXA scripts using the Keyboard Maestro Engine application.
  
 +<code javascript>​
 var kme = Application("​Keyboard Maestro Engine"​);​ var kme = Application("​Keyboard Maestro Engine"​);​
 kme.getvariable('​Var'​);​ kme.getvariable('​Var'​);​
-// kme.setvariable('​Var',​ { to: "​Hello ​There World!"​ });+kme.setvariable('​Var',​ { to: "Hello World!"​ }); 
 +</​code>​
  
 +JXA can get a list of all variables as described on the [forum](https://​forum.keyboardmaestro.com/​t/​using-km-variables-in-yosemite-javascript-for-applications-jxa/​889) and those methods also provide more convoluted ways to access variables for versions prior to 7.1.
 =====The Automation interface===== =====The Automation interface=====
  
JavaScript_for_Automation.txt · Last modified: 2019/01/12 12:43 by JMichaelTX