File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -17,22 +17,21 @@ local platform = mp.get_property_native('platform')
1717if platform == ' windows' then
1818 file = os.getenv (' TEMP' ).. ' \\ ' .. o .name
1919 cmd = {
20- ' powershell' , ' -NoProfile' , ' -Command' , ([[ & {
21- Add-Type -Assembly System.Windows.Forms;
22- Add-Type -Assembly System.Drawing;
23- $shot = [Drawing.Image]::FromFile(%q);
24- [Windows.Forms.Clipboard]::SetImage($shot);
25- }]] ):format (file )
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 .. " '))"
24+ )
2625 }
2726elseif platform == ' darwin' then
2827 file = os.getenv (' TMPDIR' ).. ' /' .. o .name
2928 -- png: «class PNGf»
3029 local type = o .type ~= ' ' and o .type or ' JPEG picture'
3130 cmd = {
32- ' osascript' , ' -e' , ( [[
33- set the clipboard to ( ¬
34- read (POSIX file %q) as %s)
35- ]] ): format ( file , type )
31+ ' osascript' , ' -e' , string.format (
32+ ' set the clipboard to (read (POSIX file %q) as %s) ' ,
33+ file , type
34+ )
3635 }
3736else
3837 file = ' /tmp/' .. o .name
You can’t perform that action at this time.
0 commit comments