-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(clipshot): fix the command on Windows #14
Conversation
Does this work for you? @Justtaway |
|
Thought so. I assume your system tries to run |
Though, I'd like you to try one more thing: replace the |
@Justtaway could you please try to run the following in powershell? powershell -NoProfile -Command 'Add-Type -Assembly System.Windows.Forms, System.Drawing;' '[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile(''C:\Users\cuzzo\AppData\Local\Temp\mpv-screenshot.jpeg''))' |
Actually, I think I found the solution. When I typed this command in powershell, I got error that powershell is not a part of cmdlet. Added %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ to PATH variable and now script is working just fine. |
@ObserverOfTime I opened this PR because the current version does not work for me: Lines 20 to 24 in 342c256
The previous version should work (though I haven't tested it): Lines 20 to 25 in 4853d93
But the previous version does not escape |
Neither does your version. 🤔 |
It does not need to be escaped in single quotes in PowerShell (only |
@Justtaway do you have any idea why it was missing from PATH? What is your Windows edition? You can check the edition by using |
Honestly, have no Idea why, I tinker a lot with stuff all the time (recently, Microsoft Store stopped updating apps for me, and I probably deleted it and can't reinstall)... Maybe because I installed new version of powershell (7.4). I have Win11 Pro 23H2 22631.3374. |
Does this also work for you? pwsh -NoProfile -Command 'Add-Type -Assembly System.Windows.Forms, System.Drawing;' '[Windows.Forms.Clipboard]::SetImage([Drawing.Image]::FromFile(''C:\Users\cuzzo\AppData\Local\Temp\mpv-screenshot.jpeg''))' |
Seems like it would work but the file doesn't exist anymore? |
My thoughts: |
Thank you. |
Fixes #13.
%q
over-escapes the string and makes a mess. It's enough to just escape the potential'
characters in the file path.P.S. Many thanks for the clipshot script :)