0

私はこの答えを探して何時間もネット上を見回したので、どこかにある場合はお詫び申し上げます。以下のこのスクリプトは、.DS_Store ファイルを返すという事実を除いて正常に動作しますが、このクエリと他のすべての隠しファイルからそれを除外するにはどうすればよいですか?

tell application "System Events" set listOfInputs to POSIX path of all disk item of all disk items a folder as list end tell

これが以下の完全なスクリプトです。作成後に in フォルダーにファイルをドロップしてきましたが、最終的には作成前にファイルの入力を求めるメッセージが表示されます。

実行中

tell application "Finder"
    if not (exists folder "IN") then
        make new folder at desktop with properties {name:"IN"}
    end if
    if not (exists folder "OUT") then
        make new folder at desktop with properties {name:"OUT"}
    end if
end tell


set theINfolder to path to the desktop as string
set a to theINfolder & "IN:"


tell application "System Events"
    set listOfInputs to POSIX path of every disk item of folder a as list
end tell

set inputs to listOfInputs

set theOutfolder to path to the desktop as string
set outputFolder to theOutfolder & "OUT:"

set params to {}

main(inputs, outputFolder, params)

エンドラン

4

2 に答える 2

1

以下が機能します。

set listOfInputs to list folder a without invisibles

ただし、without invisiblesと組み合わせることはできないPOSIX pathため、代わりにループを使用します。

set listOfInputs to {}
tell application "System Events"
    set the_items to list folder a without invisibles
    repeat with i from 1 to the count of the_items
        set this_item to alias ((a as Unicode text) & (item i of the_items))
        set end of listOfInputs to POSIX path of this_item
    end repeat
end tell
于 2013-01-10T22:39:09.207 に答える
0

List Folder コマンドは廃止され、予期せず動作しなくなる可能性があります。

試す:

set inFolder to (path to desktop as text) & "IN"
do shell script "mkdir -p " & quoted form of (POSIX path of inFolder)
set listOfInputs to paragraphs 2 thru -1 of (do shell script ("find " & quoted form of (POSIX path of inFolder) & " \\! -name \".*\""))

次のように、スペースで区切られた文字列として結果を取得できます。

set inFolder to (path to desktop as text) & "IN"
do shell script "mkdir -p " & quoted form of (POSIX path of inFolder)
set {TID, text item delimiters} to {text item delimiters, " "}
set listOfInputs to paragraphs 2 thru -1 of (do shell script ("find " & quoted form of (POSIX path of inFolder) & " \\! -name \".*\"")) as text
set text item delimiters to TID
于 2013-01-11T04:56:38.820 に答える