Comments (14)
@marcinjahn I did some changes. Can you pull and try again?
from vscode-markdown-paste-image.
Mea culpa. I have accidentally removed support for it in #54 by removing this codepath.
It will be fixed soon.
from vscode-markdown-paste-image.
You can test the fix by running
git clone https://github.com/knyzorg/vscode-markdown-paste-image
cd vscode-markdown-paste-image
npm i
npx vsce package
code --install-extension ./vscode-markdown-paste-image-0.15.2.vsix
from vscode-markdown-paste-image.
@knyzorg The error is a bit different now:
12-26 20:03:01] "vscode-markdown-paste" is now active!
[12-26 20:03:01] No scipt exists for darwin
[12-26 20:03:01] Clipboard Type:
[12-26 20:03:01] -1
[12-26 20:03:04] /Users/marcin/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res/mac.applescript: /Users/marcin/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res/mac.applescript: cannot execute binary file
from vscode-markdown-paste-image.
What happens when you try running osascript /Users/marcin/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res/mac.applescript
? Do you encounter the same error?
from vscode-markdown-paste-image.
~/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res
❯ osascript /Users/marcin/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res/mac.applescript
~/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res
It executes properly (I passed no arguments like in your example).
from vscode-markdown-paste-image.
@telesoho Do you have a macbook you can test with? I'm not sure why this is happening. It seems to work from CLI but not from the extension.
from vscode-markdown-paste-image.
@knyzorg I think there is some issue with the choice of executor. I logged the ${shell} ${options.join(" ")}
line of
the runCommand
function. I got sh /Users/marcin/.vscode/extensions/telesoho.vscode-markdown-paste-image-0.15.2/res/mac.applescript /Users/marcin/tmp/2021-12-26-20-20-59.png
. It should use osascript
instead of sh
I guess.
from vscode-markdown-paste-image.
@knyzorg Yes, that works. Actually, I started creating a branch with that fix, but you were faster. Also, you fixed more switch cases than that single place.
from vscode-markdown-paste-image.
@knyzorg Even though the functionality works, the log is a bit confusing:
[12-26 20:37:32] "vscode-markdown-paste" is now active!
[12-26 20:37:32] No scipt exists for darwin
[12-26 20:37:32] Clipboard Type:
[12-26 20:37:32] -1
"No script exists"?
from vscode-markdown-paste-image.
The way this extension is designed, it expects to have multiple scripts for each OS.
One for
- Detecting clipboard types
- Pasting images
- Pasting rich text
- Pasting plain text
The only one we have for Mac is pasting images. So the way it works is it fails detect the clipboard type for Mac and falls back to attempting to extract plain text, which if fails, runs the paste image script.
I'm not very good with Macs, so someone will need to write the other scripts.
from vscode-markdown-paste-image.
Yeah, I see that in code. I'm not good neither, today was the first time I saw actual AppleScript code :)
from vscode-markdown-paste-image.
The fix has been merged
from vscode-markdown-paste-image.
Having the same issue on macOS Monterey on version 0.18.6. Copy past image works as expected but download image results in output
[04-01 00:24:05] "vscode-markdown-paste" is now active!
[04-01 00:24:05] No scipt exists for darwin
[04-01 00:24:05] Clipboard Type:
[04-01 00:24:05] -1
from vscode-markdown-paste-image.
Related Issues (20)
- Default name to be YYYY-MM-DD_HH-mm-ss_<selected text> HOT 2
- Use in VSCode for the Web
- Add option for default alt text HOT 1
- Add ability to upload to `user-images.githubusercontent.com` similar to how GitHub does in READMEs and comments
- Mac OS Ventura: Command not found HOT 3
- Linux: Wayland support
- Paste cannot work HOT 3
- Not work in WSL mode, showing "Clipboard Type Unknown" HOT 3
- Add an option for set the name of the image HOT 1
- FYI, VS Code built in markdown extension is good enough HOT 1
- How to customize the way HTML is converted to Markdown? HOT 2
- Variable expansion in rules and Lang-rules HOT 2
- 多出来的 ** HOT 4
- The drive letter of Windows paste path should be in uppercase HOT 1
- Can't work in vscode-insider HOT 1
- Add SECURITY.md HOT 2
- Not working in Code on Debain or Ubuntu but works in Code on Windows 11 HOT 3
- Allow execution of extension in .Rmd files
- No support for image paste inside GitHub issues?
- Why there are spaces after the pasted image?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-markdown-paste-image.