Skip to content

Commit

Permalink
fix(clipshot): fix the command on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WPMGPRoSToTeMa authored and ObserverOfTime committed Apr 20, 2024
1 parent 4769ea0 commit 881b043
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions clipshot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ local platform = mp.get_property_native('platform')
if platform == 'windows' then
file = os.getenv('TEMP')..'\\'..o.name
cmd = {
'cmd', '/c', string.format(
'powershell -NoProfile -Command %q',
"Add-Type -Assembly System.Windows.Forms, System.Drawing; "..
"[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile('"..file.."'))"
'powershell', '-NoProfile', '-Command',
'Add-Type -Assembly System.Windows.Forms, System.Drawing;',
string.format(
"[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile('%s'))",
file:gsub("'", "''")
)
}
elseif platform == 'darwin' then
Expand Down

0 comments on commit 881b043

Please sign in to comment.