Page 1 of 1

File association with LUA

Posted: Tue 18 Apr, 2017 04:48
by techie
I need to setup file association that strips first two letters from a filename. I tried to do this with SET substrings, but I could not find the way to chain SET with subsequent command. Perhaps it is possible to do this with Lua scripting. Are there any examples?

File association with LUA

Posted: Tue 18 Apr, 2017 07:29
by Shmuel
Here is a tested example:
lua: win.ShellExecute(nil, nil, [[C:\Exe32\TreeSpice\Treespice.exe]], [[!\]]..([[!.!]]):sub(3))
Probably it could be also achieved without ShellExecute, by constructing a command line with Lua.

File association with LUA

Posted: Tue 18 Apr, 2017 12:31
by HaRT
techie wrote:Source of the post I could not find the way to chain SET with subsequent command
I suppose it's possible within a CMD script being called by a file association.

File association with LUA

Posted: Fri 21 Apr, 2017 07:03
by techie
Nice. Where can I lookup documentation on `lua: win.ShellExecute`?

File association with LUA

Posted: Fri 21 Apr, 2017 07:09
by techie
Also, the command is executed in popup console, is it possible to run it in Far console window?

File association with LUA

Posted: Fri 21 Apr, 2017 08:21
by Shmuel
techie wrote:Source of the post Also, the command is executed in popup console, is it possible to run it in Far console window?
lua: Far.DisableHistory(0xF) Keys"CtrlY" print([[C:\Exe32\TreeSpice\Treespice.exe !\]]..([[!.!]]):sub(3)) Keys"Enter"