1

次のアップルスクリプトを実行しています:

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"}

automator に渡す POSIX パス (/Users/sam/Desktop/Resized/HighResCat.jpg) が必要な場所

++++++++++++ 編集

ここまではできましたが、すべてのアイテムが必要なときに、一度に渡すことができるリストのアイテムは 1 つだけです。

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に変換しました

+++++++++EDIT2

このスクリプトは 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

ありがとう

4

1 に答える 1

1

試す:

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
于 2013-07-28T17:36:23.470 に答える