
选中之后复制出来做为预览图片,在 windows 系统下,有这种操作吗
1 proxytoworld 2023-11-13 10:29:19 +08:00 只能用脚本吧 |
2 lisxour 2023-11-13 10:29:41 +08:00 资源管理器没有这种操作,只有代码才能实现 |
3 tool2d 2023-11-13 10:30:24 +08:00 问了一下 gpt: "写一个 bat, 遍历目录,列出每个目录下的第一个图片文件。" 直接帮我了写一个。 |
4 franswish 2023-11-13 15:17:45 +08:00 via Android 如何定义“第一个”?首字母排序?创建时间排序? |
5 byzod 2023-11-15 16:44:00 +08:00 正好之前写了个蛋疼的“根据 id 分组并统计作品数量阈值挑选一张每个艺术家最新的作品” 你改改就能用了 ``` #Requires Autohotkey v2.0+ #SingleInstance Force SrcFolder := "Q:\Doc\Pic\#Pixiv" DestFolder := "Q:\Doc\Pic\#Pixiv\#Index" idRegex := "^(\d+)\s+-\s+.+$" ; id as group 1 Threshold := 20 IdList := Map() Loop Files, SrcFolder . "\*.*", "F" { ; 处理文件列表 fileName := Trim(A_LoopFileName) matchArray := {} match := RegExMatch(fileName, idRegex, &matchArray) if (match) { id := matchArray[1] if (!IdList.Has(id)) { IdList.Set(id, IdInfo(id, 1, A_LoopFilePath)) } else { IdList.Get(id).count += 1 IdList.Get(id).latestFile := A_LoopFilePath IdList.Get(id).latestFileName := fileName } } } ; 阈值过滤 IdListPicked := Map() for id, info in IdList { if (info.count >= Threshold) { IdListPicked.Set(id, info) } } ; 移动 debug_pickArtStr := "" ;debug if (IdListPicked.Count > 0){ try FileDelete(DestFolder . "\*.*") try DirCreate(DestFolder) for id, info in IdListPicked { if(FileExist(info.latestFile)) { FileCopy(info.latestFile, DestFolder) ; debug_pickArtStr .= info.count . ": " . info.latestFileName . "`n" ;debug } } } ; 输出到文件 ; 输出处理完成的消息 MsgBox("文件处理完成`n`n" "作品数量阈值" . Threshold . "`n 共" . IdListPicked.Count . "艺术家符合" ) ; MsgBox(debug_pickArtStr) ;debug Class IdInfo { id := 0 count := 0 latestFile := "" __New(id:=0, count:=0, latestFile:="", latestFileName:="") { this.id := id this.count := count this.latestFile := latestFile this.latestFileName := latestFileName } } ExitApp ``` |