Skip to content

Add API functions to call AutoKey scripts as functions #246

@luziferius

Description

@luziferius

Classification:

Enhancement to the scripting API

Version

AutoKey version: All < 0.96.0

Summary

Add functionality to call scripts like functions.

Proposal:

  • Add further optional arguments (*args, **kwargs) to engine.run_script(script_name)
  • Arguments can be accessed using a getter function. Something like engine.get_macro_arguments()?
  • Return values can be set using the existing engine.set_return_value()
  • engine.run_script() should return the value set by engine.set_return_value()

Notes

There is a possible workaround that involves using the global scripting store. It takes quite some effort to use, because it is persistent and needs to be cleared after usage to not carry old data.

Metadata

Metadata

Assignees

Labels

enhancementscriptingIssues related to Scripts or the scripting API

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions