Skip to content

Commit fa25ec4

Browse files
authored
OpenInExplorer Tap to Space
1 parent 3df9040 commit fa25ec4

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

contrib/OpenInExplorer.lua

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,39 @@ du.check_min_api_version("5.0.0", "OpenInExplorer")
4343
--Detect OS and modify accordingly--
4444
local proper_install = false
4545
if dt.configuration.running_os == "windows" then
46-
proper_install = true
46+
proper_install = true
4747
else
48-
dt.print_error('OpenInExplorer plug-in only supports Windows OS at this time')
49-
return
48+
dt.print_error('OpenInExplorer plug-in only supports Windows OS at this time')
49+
return
5050
end
5151

5252
-- FUNCTION --
5353
local function OpenInExplorer() --Open in Explorer
54-
--Inits--
55-
if not proper_install then
56-
return
57-
end
58-
local images = dt.gui.selection()
59-
local curr_image = ""
60-
if #images == 0 then
61-
dt.print('please select an image')
62-
elseif #images <= 15 then
63-
for _,image in pairs(images) do
64-
curr_image = image.path..'\\'..image.filename
65-
local run_cmd = "explorer.exe /select, "..curr_image
66-
dt.print_log("OpenInExplorer run_cmd = "..run_cmd)
67-
resp = dsys.external_command(run_cmd)
68-
end
69-
else
70-
dt.print('please select fewer images (max 15)')
71-
end
54+
--Inits--
55+
if not proper_install then
56+
return
57+
end
58+
local images = dt.gui.selection()
59+
local curr_image = ""
60+
if #images == 0 then
61+
dt.print('please select an image')
62+
elseif #images <= 15 then
63+
for _,image in pairs(images) do
64+
curr_image = image.path..'\\'..image.filename
65+
local run_cmd = "explorer.exe /select, "..curr_image
66+
dt.print_log("OpenInExplorer run_cmd = "..run_cmd)
67+
resp = dsys.external_command(run_cmd)
68+
end
69+
else
70+
dt.print('please select fewer images (max 15)')
71+
end
7272
end
7373

7474
-- GUI --
7575
if proper_install then
76-
dt.gui.libs.image.register_action(
77-
"show in file explorer",
78-
function() OpenInExplorer() end,
79-
"Opens File Explorer at the selected image's location"
80-
)
76+
dt.gui.libs.image.register_action(
77+
"show in file explorer",
78+
function() OpenInExplorer() end,
79+
"Opens File Explorer at the selected image's location"
80+
)
8181
end

0 commit comments

Comments
 (0)