Javascript 关闭和';另存为';一次处理100个MS绘制文件?

Javascript 关闭和';另存为';一次处理100个MS绘制文件?,javascript,powershell,command-line-interface,batch-processing,paint,Javascript,Powershell,Command Line Interface,Batch Processing,Paint,我每天拍摄100张打印屏幕图像,然后将它们粘贴到另外100毫秒的绘画文件上。我需要一次自动保存所有100个打开的文件。我知道使用“tasklist | find“mspaint”将带来所有具有流程ID的任务,但如何添加更多步骤以使其一次保存?e、 g.1.png,2.png…100.png。完全忘记mspaint-使用Windows PowerShell的获取剪贴板命令获取屏幕截图并以编程方式将其写入磁盘: <# use PrintScreen or Snipping Tool to ca

我每天拍摄100张打印屏幕图像,然后将它们粘贴到另外100毫秒的绘画文件上。我需要一次自动保存所有100个打开的文件。我知道使用“tasklist | find“mspaint”将带来所有具有流程ID的任务,但如何添加更多步骤以使其一次保存?e、 g.1.png,2.png…100.png。

完全忘记
mspaint
-使用Windows PowerShell的
获取剪贴板
命令获取屏幕截图并以编程方式将其写入磁盘:

<# use PrintScreen or Snipping Tool to capture the screen and copy to clipboard as normal #>

# then grab from clipboard
$screenshot = Get-Clipboard -Format Image

# then save to disk
$screenshot.Save("C:\path\to\screenshot.png", [System.Drawing.Imaging.ImageFormat]::Png)

# and free it from memory
$screenshot.Dispose()

#然后从剪贴板抓取
$screenshot=获取剪贴板-格式化图像
#然后保存到磁盘
$screenshot.Save(“C:\path\to\screenshot.png”,[System.Drawing.Imaging.ImageFormat]::png)
#把它从记忆中解放出来
$screenshot.Dispose()
多亏了这篇文章,我终于找到了我问题的完美答案。整个过程可以使用powershell ise完全自动化

Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -Action {
    $content = Get-Clipboard -Format Image
    If ($content) 
    {
        $path = $psISE.CurrentFile.FullPath | Split-Path
        $filename = "$path\ImageCap - " + (Get-date -Format 'hh-mm-ss') + '.png'
        $content.Save($filename,'png')
        Set-Clipboard -Value $Null
    }
} 

1) 也不是Powershell,javascript都不会帮你,因为Powershell很难与非.Net窗口(如paint)进行通信2)为什么要这样做?当你点击
PrnScr
时,有很多软件可以将屏幕截图保存到文件中。请描述一下你到底做了什么以及为什么,也许我们可以用不同的方法解决这个问题。@filimonic如果你使用Windows+PrtScr,它会在图片/屏幕截图folderXnView中创建一个图像。这是一个不错的交易。也可以跳过变量的赋值和释放,使用一行代码
(获取剪贴板-格式图像)。保存(“C:\path\to\screenshot.png”,[System.Drawing.Imaging.ImageFormat]::png)