How to use the ahk.execute function in ahk

To help you get started, we’ve selected a few ahk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fx-kirin / pyahk / test / script.py View on Github external
with self.assertRaises(AttributeError):
            script.function('_badname')
            script.function('function')
            script.function('test')
        # Test getting variable value
        self.assertEqual(script.test, value,
             msg="Variable value {0} doesn't match expected {1}!".format(
                 script.test, value))
        # Test setting variable value
        value = 10
        script.test = 10
        self.assertEqual(script.test, value,
             msg="Variable value {0} doesn't match expected {1}!".format(
                 script.test, value))
        # Test outside modification
        ahk.execute("test := test+5\n")
        self.assertEqual(script.test, value+5,
             msg="Variable value {0} doesn't match expected {1}!".format(
                 script.test, value+5))
github fx-kirin / pyahk / test / control.py View on Github external
def store(cmd):
                """execute replacement for mock."""
                # Object in outer scope used in closure to store a value
                inner_delay.append(int(ahk.get("A_ControlDelay")))
                if 'send' not in cmd.lower():
                    #print cmd, inner_delay
                    ahk.execute(cmd)