Path 将查找器路径应用于POSIX路径

Path 将查找器路径应用于POSIX路径,path,applescript,finder,Path,Applescript,Finder,我正在运行以下applescript: tell application "Finder" set input to POSIX file "/Users/sam/Desktop/Resized" set theFiles to (every file of folder input whose name does not contain "- Resized") end tell return theFiles 它正常工作,尽管它正在恢复: {document file "HighResC

我正在运行以下applescript:

tell application "Finder"
set input to POSIX file "/Users/sam/Desktop/Resized"
set theFiles to (every file of folder input whose name does not contain "- Resized")
end tell

return theFiles
它正常工作,尽管它正在恢复:

{document file "HighResCat.jpg" of folder "Resized" of folder "Desktop" of folder "sam" of    folder "Users" of startup disk of application "Finder", document file "madonna.jpg" of folder "Resized" of folder "Desktop" of folder "sam" of folder "Users" of startup disk of application "Finder"}
其中我需要一个POSIX路径(/Users/sam/Desktop/Resized/HighResCat.jpg)来传递给automator

++++++++++++编辑

到目前为止,我已经做到了,但是当我需要所有项目时,我一次只能通过列表中的一项

tell application "Finder"
    set input to POSIX file "/Users/sam/Desktop/Resized"
    set theFiles to (every file of folder input whose name does not contain "-  Resized")
set input to item 1 of theFiles as string
end tell


return (POSIX file input)
我转换为字符串,返回时转换为POSIX

+++++++++编辑2

此脚本在automator中工作:

on run {input, parameters}
set input to (input) as string
tell application "System Events" to set theFiles to POSIX path of (files of folder    input whose name does not contain "- Resized")
set input to theFiles
return input
end run
谢谢

试试:

set input to "/Users/sam/Desktop/Resized"
tell application "System Events" to set theFiles to POSIX path of (files of folder input whose name does not contain "- Resized")
return theFiles
尝试:


Result:error“系统事件”出现错误:无法将文件\“Macintosh HD:Users:sam:Desktop:Resized\”转换为整型。文件“Macintosh HD:Users:sam:Desktop:Resized”中的数字-1700转换为整型您是否将代码准确地
将输入设置为“/Users/sam/Desktop/Resized”
,或者是否使用了
将输入设置为POSIX文件“/Users/sam/Desktop/Resized”
结果:错误“系统事件发生错误:无法将文件\“Macintosh HD:用户:sam:Desktop:Resized\”复制为整型。“文件中的编号-1700”“Macintosh HD:Users:sam:Desktop:Resized”为整数
每次我试图将路径转换为POSIX时,都会说它无法将“path”转换为整数。您是将代码准确地复制到“/Users/sam/Desktop/Resized”
还是使用了“
将输入设置为POSIX文件“/Users/sam/Desktop/Resized”