Comments (15)
i solved by add powershell.exe path to the environment variable PATH.
from vscode-markdown-paste-image.
Could any one indicate the "exact content" for below?
- add powershell.exe path to the environment variable PATH?
from vscode-markdown-paste-image.
Hello @Eucaly !
I have still the same problem. Here is the output:
PS C:\Users\gusbe> $env:path
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\gusbe\AppData\Local\Microsoft\WindowsApps;D:\gusbe\Applications\VSCode Insiders\bin
from vscode-markdown-paste-image.
And I installed PowerShell 7, but it was not successful to copy and paste on VSCode:
PS C:\Users\gusbe> $env:Path -split ';'
C:\Program Files\PowerShell\7
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\dotnet\
C:\Program Files\PowerShell\7\
C:\Users\gusbe\AppData\Local\Microsoft\WindowsApps
D:\gusbe\Applications\VSCode Insiders\bin
from vscode-markdown-paste-image.
As of powershell 6.0, the executable is named pwsh.exe
from vscode-markdown-paste-image.
Extension not working no Vscode 1.51.0
from vscode-markdown-paste-image.
Extension not working no Vscode 1.51.0
Extension for Windows 10 not working on VS Code v1.53.1
from vscode-markdown-paste-image.
Extension not working on 1.55.2
from vscode-markdown-paste-image.
1.57.1
paste pic ok。
but paste regex string no working。
arch linux
from vscode-markdown-paste-image.
1.57.1
paste pic ok。
but paste regex string no working。
arch linux
On native Linux or on WSL? Did you install xclip
?
from vscode-markdown-paste-image.
1.57.1
paste pic ok。
but paste regex string no working。
arch linuxOn native Linux or on WSL? Did you install
xclip
?
yes. native arch linux.
According to xclip's information, there is more than one clipboard, but multiple:
primary
secondary
clipboard
buffer-cut
vscode editor using 1. markdown paste using 3.
So, not working
I think...
from vscode-markdown-paste-image.
I installed the latest version of btoh powershell, vscode and this extension- the mark down paste action is pasting a 20 page long binary of the copied image: something like this
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABLcAAAF8CAYAAAA971neAAAgAElEQVR4AeydMZLDPHK2fYCVyy7bf+YbOLNqk73AHsBbCjbaM7hK0R7CVQq/2JEjhd8FNlL8lSNfhX+B1As0oQYIcMgZceYJpsihgEaj
from vscode-markdown-paste-image.
For anyone else struggling to do this, I have written a simple Python
script that I call from a VS Code shortcut to store the image (if in clipboard) to a folder in the root directory of the .md
file and then store to clipboard the text to paste into the .md
file that links to the image.
import os
from PIL import ImageGrab
import pyperclip
import sys
import tag_counter
import timestamp as ts
class getClip:
def __init__(self, mdPath, mdBaseName, imageDescription, imageTitle):
img = ImageGrab.grabclipboard()
if isinstance(img, type(None)):
sys.exit("ERROR! Please copy an image.")
else:
filePath = mdPath
relativeFilePath = "/".join([filePath, mdBaseName])
try: os.mkdir(relativeFilePath)
except OSError as error: print(error)
when = ts.when()
imageTitle = str.lower(imageTitle).replace(" ", "_")
imageName = f"{imageTitle}_{when}.png"
fileName = f"{relativeFilePath}/{imageName}"
pasteName = f"./{mdBaseName}/{imageName}"
img.save(fileName, format="PNG")
fig_number = tag_counter.getCount(mdPath, mdBaseName)
pyperclip.copy(\
f"| ![]({pasteName}) |\n" + \
"|:--:|\n" + \
f"| {imageDescription} " + "\\\\(\\tag{" + f"{fig_number+1}" + "} \\label{fig:" + f"{imageTitle}" + "}\\\\) |"\
)
print(f"Completed {fileName}")
if __name__ == "__main__":
getClip(str(sys.argv[1]), str(sys.argv[2]), str(sys.argv[3]), str(sys.argv[4]))
from vscode-markdown-paste-image.
For anyone else struggling to do this, I have written a simple
Python
script that I call from a VS Code shortcut to store the image (if in clipboard) to a folder in the root directory of the.md
file and then store to clipboard the text to paste into the.md
file that links to the image.import os from PIL import ImageGrab import pyperclip import sys import tag_counter import timestamp as ts class getClip: def __init__(self, mdPath, mdBaseName, imageDescription, imageTitle): img = ImageGrab.grabclipboard() if isinstance(img, type(None)): sys.exit("ERROR! Please copy an image.") else: filePath = mdPath relativeFilePath = "/".join([filePath, mdBaseName]) try: os.mkdir(relativeFilePath) except OSError as error: print(error) when = ts.when() imageTitle = str.lower(imageTitle).replace(" ", "_") imageName = f"{imageTitle}_{when}.png" fileName = f"{relativeFilePath}/{imageName}" pasteName = f"./{mdBaseName}/{imageName}" img.save(fileName, format="PNG") fig_number = tag_counter.getCount(mdPath, mdBaseName) pyperclip.copy(\ f"| ![]({pasteName}) |\n" + \ "|:--:|\n" + \ f"| {imageDescription} " + "\\\\(\\tag{" + f"{fig_number+1}" + "} \\label{fig:" + f"{imageTitle}" + "}\\\\) |"\ ) print(f"Completed {fileName}") if __name__ == "__main__": getClip(str(sys.argv[1]), str(sys.argv[2]), str(sys.argv[3]), str(sys.argv[4]))
@jmanthony3, does it work with us on company's computers when PowerShell is blocked?
from vscode-markdown-paste-image.
I should think that if you were able to run Python scripts that you could run this. The computer I wrote this on is a company machine which I have admin over so I do not know if it would run without the elevated privileges.
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.