Skip to content

Commit 881b043

Browse files
WPMGPRoSToTeMaObserverOfTime
authored andcommitted
fix(clipshot): fix the command on Windows
1 parent 4769ea0 commit 881b043

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clipshot.lua

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ local platform = mp.get_property_native('platform')
1717
if platform == 'windows' then
1818
file = os.getenv('TEMP')..'\\'..o.name
1919
cmd = {
20-
'cmd', '/c', string.format(
21-
'powershell -NoProfile -Command %q',
22-
"Add-Type -Assembly System.Windows.Forms, System.Drawing; "..
23-
"[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile('"..file.."'))"
20+
'powershell', '-NoProfile', '-Command',
21+
'Add-Type -Assembly System.Windows.Forms, System.Drawing;',
22+
string.format(
23+
"[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile('%s'))",
24+
file:gsub("'", "''")
2425
)
2526
}
2627
elseif platform == 'darwin' then

0 commit comments

Comments
 (0)