Giter VIP home page Giter VIP logo

Comments (14)

vezaynk avatar vezaynk commented on August 23, 2024 1

@marcinjahn I did some changes. Can you pull and try again?

from vscode-markdown-paste-image.

vezaynk avatar vezaynk commented on August 23, 2024

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.

vezaynk avatar vezaynk commented on August 23, 2024

@marcinjahn

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.

marcinjahn avatar marcinjahn commented on August 23, 2024

@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.

vezaynk avatar vezaynk commented on August 23, 2024

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.

marcinjahn avatar marcinjahn commented on August 23, 2024
~/.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.

vezaynk avatar vezaynk commented on August 23, 2024

@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.

marcinjahn avatar marcinjahn commented on August 23, 2024

@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.

marcinjahn avatar marcinjahn commented on August 23, 2024

@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.

marcinjahn avatar marcinjahn commented on August 23, 2024

@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.

vezaynk avatar vezaynk commented on August 23, 2024

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.

marcinjahn avatar marcinjahn commented on August 23, 2024

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.

vezaynk avatar vezaynk commented on August 23, 2024

The fix has been merged

from vscode-markdown-paste-image.

JeffersonDing avatar JeffersonDing commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.