Here is the whole macro:
Code: Select all
Macro {
key="CtrlAltO";
area="Common";
description="Clone Far";
action=function()
local FarName=win.GetEnv("FARHOME").."\\far.exe"
local ConemuName=win.GetEnv("FARHOME").."\\conemu.exe"
local StartFile=win.GetEnv("TEMP").."\\startfile.txt"
local FarLeft,FarRight
-- if APanel.Left then FarLeft=APanel.Path..'\\.' FarRight=PPanel.Path..'\\.' end
-- if PPanel.Left then FarLeft=PPanel.Path..'\\.' FarRight=APanel.Path..'\\.' end
if APanel.Left then FarLeft=APanel.Path FarRight=PPanel.Path end
if PPanel.Left then FarLeft=PPanel.Path FarRight=APanel.Path end
if APanel.Left and APanel.Prefix=='arc' then FarLeft ='arc:'..APanel.HostFile end
if not APanel.Left and APanel.Prefix=='arc' then FarRight='arc:'..APanel.HostFile end
if PPanel.Left and PPanel.Prefix=='arc' then FarLeft ='arc:'..PPanel.HostFile end
if not PPanel.Left and PPanel.Prefix=='arc' then FarRight='arc:'..PPanel.HostFile end
if FarLeft =='' then FarLeft ='c:' end
if FarRight=='' then FarRight='c:' end
local Text='"'..FarName..'" "'..FarLeft..'" "'..FarRight..'"'
-- OEM code page 852
win.ShellExecute(nil,nil,'cmd.exe','/c echo '..Text..' > '..StartFile,nil,nil)
-- UTF8 65001
-- local File=io.open(StartFile,"w+b")
-- if File then
-- File:write(Text) File:close()
-- end
win.ShellExecute(nil,nil,ConemuName,'/cmd @'..StartFile,nil,nil) -- StartFile is read as ANSI
end;
}