@@ -43,39 +43,39 @@ du.check_min_api_version("5.0.0", "OpenInExplorer")
43
43
-- Detect OS and modify accordingly--
44
44
local proper_install = false
45
45
if dt .configuration .running_os == " windows" then
46
- proper_install = true
46
+ proper_install = true
47
47
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
50
50
end
51
51
52
52
-- FUNCTION --
53
53
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
72
72
end
73
73
74
74
-- GUI --
75
75
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
+ )
81
81
end
0 commit comments