Run lua script (with Hotkey definition) from Command Line

Here you can discuss any topic concerning Far macro commands.
Post Reply
farman
Posts: 118
Joined: Thu 03 Sep, 2009 11:32
Been thanked: 2 times

Run lua script (with Hotkey definition) from Command Line

Post by farman »

To run a Lua script from command line there is "lua: @<filename> [<args>]".

But I like to execute a script with a defined hotkey (i.e. the simplified script below) from a scriptfile with other functions in it.
This should work in in FAR menu "File associations". Is there a way to do this?

Code: Select all

Macro { description="Test 1"; area="Shell"; key="CtrlShiftF3"; flags="";
        action = function()  Keys("F3")  end; }
Shmuel
Posts: 6815
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 526 times

Run lua script (with Hotkey definition) from Command Line

Post by Shmuel »

farman wrote: But I like to execute a script with a defined hotkey
May be lua:eval("Shell/F3",2) is what you want.
farman
Posts: 118
Joined: Thu 03 Sep, 2009 11:32
Been thanked: 2 times

Run lua script (with Hotkey definition) from Command Line

Post by farman »

Great. Executing a macro from a script file: "lua:eval("Shell/CtrlShiftF3", 2)" works fine.

Einstein was wrong. There IS someone faster than the speed of light. Thanx, Shmuel.
Post Reply

Return to “Macro Commands Discussions”