File association with LUA
File association with LUA
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?
-
- Posts: 6820
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 528 times
File association with LUA
Here is a tested example:
Probably it could be also achieved without ShellExecute, by constructing a command line with Lua.
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.
- HaRT
- Moderator
- Posts: 10823
- Joined: Tue 30 Aug, 2005 17:21
- Has thanked: 221 times
- Been thanked: 358 times
File association with LUA
I suppose it's possible within a CMD script being called by a file association.
Фар есть инструмент, а не нянька. © 2009 DrKnS
File association with LUA
Also, the command is executed in popup console, is it possible to run it in Far console window?
-
- Posts: 6820
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 528 times
File association with LUA
lua: Far.DisableHistory(0xF) Keys"CtrlY" print([[C:\Exe32\TreeSpice\Treespice.exe !\]]..([[!.!]]):sub(3)) Keys"Enter"
Last edited by Shmuel on Fri 21 Apr, 2017 08:23, edited 1 time in total.