我尝试在Photoshop中遍历所有打开的文档,以获取每个图像的高度和宽度。
不管是什么原因,我在循环中第二次得到一个错误,说它不能得到第二个项目。(第5行出现错误)
代码:
tell application "Adobe Photoshop 2020"
set currentDocs to documents
set myList to {}
repeat with n from 1 to count of currentDocs
set currentDoc to current document of item n
tell currentDoc
set theDimensions to bounds of current layer
set theWidth to item 3 of theDimensions
set theHeight to item 4 of theDimensions
set theDimensions to theWidth & theHeight
set end of myList to theDimensions
end tell
end repeat
end tell发布于 2020-11-03 05:39:20
您必须获取currentDocs的项目n
set currentDoc to item n of currentDocs或者使用repeat with ... in ...语法
repeat with currentDoc in currentDocs
tell currentDoc ...https://stackoverflow.com/questions/64653375
复制相似问题