-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugins.Shell.lua
More file actions
212 lines (150 loc) · 4.35 KB
/
Plugins.Shell.lua
File metadata and controls
212 lines (150 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
--[[ Shell macros with plugins ]]--
----------------------------------------
--[[ description:
-- Macros for shell area with plugins.
-- Макросы для области оболочки с плагинами.
--]]
----------------------------------------
--[[ uses:
nil.
-- group: Macros/Plugins.
--]]
--------------------------------------------------------------------------------
----------------------------------------
local far = far
local F = far.Flags
--------------------------------------------------------------------------------
--local unit = {}
----------------------------------------
local guids = {}
--unit.guids = guids
local Macro = Macro or function () end
--local Async = function () return mmode(3, 1) end
local Plugin = Plugin or {}
local PluginExist = Plugin.Exist
local PluginMenu = Plugin.Menu
--local PluginMenu, CallPlugin = Plugin.Menu, Plugin.Call
local Exist
---------------------------------------- '`' -- FarCmds
-- [[
--guids.FarCmds = ""
--]]
---------------------------------------- 'E' -- EMenu
-- [[
guids.EMenu = "742910F1-02ED-4542-851F-DEE37C2E13B2"
Exist = function () return PluginExist(guids.EMenu) end
Macro {
area = "Shell",
key = "RAltApps",
flags = "",
description = "EMenu: My Computer",
condition = Exist,
action = function ()
PluginMenu(guids.EMenu)
Keys"Down Enter"
exit()
end, ---
} ---
--]]
---------------------------------------- '[' -- TmpPanel
-- [[
guids.TmpPanel = "B77C964B-E31E-4D4C-8FE5-D6B0C6853E7C"
Exist = function () return PluginExist(guids.TmpPanel) end
Macro {
area = "Shell",
key = "RCtrlApps",
flags = "",
description = "TmpPanel: Shortcuts",
condition = Exist,
action = function ()
print("tmp:+menu %FarLocalProfile%\\Shortcuts.temp")
Keys"Enter"
exit()
end, ---
} ---
Macro {
area = "Shell",
key = "RAltShiftF2",
flags = "",
description = "TmpPanel: Save to file",
condition = Exist,
action = function ()
Keys"AltShiftF2"
exit()
end, ---
} ---
--]]
---------------------------------------- '7' -- ArcLite
-- [[
guids.ArcLite = "65642111-AA69-4B84-B4B8-9249579EC4FA"
guids.ArcLiteArchive = "CD57D7FA-552C-4E31-8FA8-73D9704F0666"
Exist = function () return PluginExist(guids.ArcLite) end
Macro {
area = "Shell",
key = "LAltShiftF1",
flags = "",
description = "Arch: Choose profile…",
condition = Exist,
action = function ()
if not PluginMenu(guids.ArcLite) then return end
-- Окно "Создание архива"
Keys"Down Down Enter"
if not Area.Dialog or Dlg.Id ~= guids.ArcLiteArchive then
return
end
-- Поиск поля "Профиль"
local k, Count = 0, Dlg.ItemCount
repeat
k = k + 1
Dlg.SetFocus(k)
until k > Count or Dlg.ItemType == F.DI_COMBOBOX
if k > Count then return end
Keys"CtrlDown"
exit()
end, ---
} ---
Macro { -- Editor.WordDiv must be consist "."
area = "Shell",
key = "LCtrlShiftF1",
flags = "",
description = "Arch: Make archive…",
condition = function ()
return PluginExist(guids.ArcLite) and APanel.FilePanel
end, ---
action = function ()
local Panel = APanel
local IsFile = not Panel.Folder
local Selected = Panel.Selected
local Name = Panel.Current
local ExtPos = Name:cfind("%.[^%.]-$")
if not PluginMenu(guids.ArcLite) then return end
-- Окно "Создание архива"
Keys"Down Down Enter"
if not Area.Dialog or Dlg.Id ~= guids.ArcLiteArchive then
return
end
if not Selected and IsFile and
ExtPos and ExtPos > Name:len() - 7 then
Keys"CtrlLeft CtrlBS"
end
Keys"Home ShiftEnd CtrlShiftLeft ShiftLeft"
exit()
end, ---
} ---
Macro {
area = "Shell",
key = "LCtrlAltShiftF1",
flags = "",
description = "Arch: Test archive",
condition = Exist,
action = function ()
Keys"ShiftF3"
if Area.Menu then Keys"Enter" end
--if not PluginMenu(guids.ArcLite) then return end
--Keys"Up Up Enter"
-- Окно "Результат тестирования архива"
exit()
end, ---
} ---
--]]
--------------------------------------------------------------------------------